From 3729d6a985b8e857166a23209df2867320318a89 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Mon, 4 Mar 2019 09:44:24 -0500 Subject: [PATCH] test/rgw: fix race in test_rgw_reshard_wait start the timer before scheduling the wait Signed-off-by: Casey Bodley --- src/test/rgw/test_rgw_reshard_wait.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/rgw/test_rgw_reshard_wait.cc b/src/test/rgw/test_rgw_reshard_wait.cc index 8996e5cb7d1..e951bc1acb1 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;