test/rgw: fix race in test_rgw_reshard_wait

start the timer before scheduling the wait

Signed-off-by: Casey Bodley <cbodley@redhat.com>
This commit is contained in:
Casey Bodley 2019-03-04 09:44:24 -05:00
parent 634780fe07
commit 3729d6a985

View 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;