From: Casey Bodley Date: Mon, 4 Mar 2019 14:44:24 +0000 (-0500) Subject: test/rgw: fix race in test_rgw_reshard_wait X-Git-Tag: v14.1.1~64^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F26741%2Fhead;p=ceph.git test/rgw: fix race in test_rgw_reshard_wait start the timer before scheduling the wait Signed-off-by: Casey Bodley --- diff --git a/src/test/rgw/test_rgw_reshard_wait.cc b/src/test/rgw/test_rgw_reshard_wait.cc index 8996e5cb7d16..e951bc1acb16 100644 --- a/src/test/rgw/test_rgw_reshard_wait.cc +++ b/src/test/rgw/test_rgw_reshard_wait.cc @@ -67,10 +67,10 @@ TEST(ReshardWait, wait_yield) EXPECT_EQ(0, waiter.wait(optional_yield{context, yield})); }); + const ceph::real_time start = ceph::real_clock::now(); EXPECT_EQ(1u, context.poll()); // spawn EXPECT_FALSE(context.stopped()); - const ceph::real_time start = ceph::real_clock::now(); EXPECT_EQ(1u, context.run_one()); // timeout EXPECT_TRUE(context.stopped()); const ceph::timespan elapsed = ceph::real_clock::now() - start;