]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
remove racy test assertions 499/head
authorLoic Dachary <loic@dachary.org>
Mon, 12 Aug 2013 13:20:57 +0000 (15:20 +0200)
committerLoic Dachary <loic@dachary.org>
Wed, 14 Aug 2013 13:13:27 +0000 (15:13 +0200)
Do not assert before the loop waiting for the thread to complete the
expected side effect. The whole point of the loop is to make sure
there is no window of opportunity for a race condition and asserting
before it means taking a useless risk. If run enough times, it will
happen.

Signed-off-by: Loic Dachary <loic@dachary.org>
src/test/test_osd_types.cc

index fa4ae6163ac7fff48a404d567b76eb364f23225b..730a8ffdc5d0161180b325871ca8dc6e476d142f 100644 (file)
@@ -1081,11 +1081,6 @@ TEST_F(ObjectContextTest, read_write_lock)
 
     obc.ondisk_write_unlock();
 
-    EXPECT_EQ(1, obc.readers_waiting);
-    EXPECT_EQ(0, obc.readers);
-    EXPECT_EQ(0, obc.writers_waiting);
-    EXPECT_EQ(0, obc.unstable_writes);
-
     do {
       cout << "Trying (2) with delay " << delay << "us\n";
       usleep(delay);
@@ -1144,11 +1139,6 @@ TEST_F(ObjectContextTest, read_write_lock)
 
     obc.ondisk_read_unlock();
 
-    EXPECT_EQ(0, obc.readers_waiting);
-    EXPECT_EQ(0, obc.readers);
-    EXPECT_EQ(1, obc.writers_waiting);
-    EXPECT_EQ(0, obc.unstable_writes);
-
     do {
       cout << "Trying (4) with delay " << delay << "us\n";
       usleep(delay);