diff options
author | Loic Dachary <loic@dachary.org> | 2013-08-12 15:20:57 +0200 |
---|---|---|
committer | Loic Dachary <loic@dachary.org> | 2013-08-14 15:13:27 +0200 |
commit | dfd58548d961d496086e556bd228f34737be49b0 (patch) | |
tree | 60da921aadc1495a56485e2d886be5a124640bab | |
parent | 90ccd2676afed19d496b9d59bb51c46b01a37ffa (diff) | |
download | ceph-dfd58548d961d496086e556bd228f34737be49b0.tar.gz |
remove racy test assertions
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>
-rw-r--r-- | src/test/test_osd_types.cc | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/src/test/test_osd_types.cc b/src/test/test_osd_types.cc index fa4ae6163ac..730a8ffdc5d 100644 --- a/src/test/test_osd_types.cc +++ b/src/test/test_osd_types.cc @@ -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); |