]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test/rgw: fix race in test_rgw_reshard_wait 26741/head
authorCasey Bodley <cbodley@redhat.com>
Mon, 4 Mar 2019 14:44:24 +0000 (09:44 -0500)
committerCasey Bodley <cbodley@redhat.com>
Mon, 4 Mar 2019 14:44:26 +0000 (09:44 -0500)
start the timer before scheduling the wait

Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/test/rgw/test_rgw_reshard_wait.cc

index 8996e5cb7d1664c88928f7dc52bc6eaaeb55a4f9..e951bc1acb16b611cc443ad67986ec10aad4a2d3 100644 (file)
@@ -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;