diff options
author | Andy Schwerin <Andy Schwerin schwerin@mongodb.com> | 2017-03-15 13:46:16 -0400 |
---|---|---|
committer | Andy Schwerin <Andy Schwerin schwerin@mongodb.com> | 2017-03-15 13:46:16 -0400 |
commit | b9827dcc65c15eae2b863b9a0a60a9864ba3f98b (patch) | |
tree | 854a86b8d9e4adc1d0f51e0d3143d37ca3be9798 /src | |
parent | 1515d4e4e2613e79b2c1761b7505cfaa9c31f0a9 (diff) | |
download | mongo-b9827dcc65c15eae2b863b9a0a60a9864ba3f98b.tar.gz |
SERVER-25062 Remove racy, redundant SleepForExpires test from operation_context_test.
Since OperationContext::sleepFor is a thin wrapper around the predicate form of
OperationContext::waitForConditionOrInterrupt, the SleepForExpires test duplicates
coverage from the SleepUntilExpires and ForExpiresWhileWaiting tests. It is also
racy, because it must sleep on a different condition variable from the one supplied
in the WaitTestState.
Diffstat (limited to 'src')
-rw-r--r-- | src/mongo/db/operation_context_test.cpp | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/src/mongo/db/operation_context_test.cpp b/src/mongo/db/operation_context_test.cpp index 3592e4dd3c1..95f53cf8053 100644 --- a/src/mongo/db/operation_context_test.cpp +++ b/src/mongo/db/operation_context_test.cpp @@ -513,21 +513,6 @@ TEST_F(ThreadedOperationDeadlineTests, SleepForWithExpiredForDoesNotBlock) { ASSERT_FALSE(waiterResult.get()); } -TEST_F(ThreadedOperationDeadlineTests, SleepForExpires) { - auto opCtx = client->makeOperationContext(); - WaitTestState state; - const auto startDate = mockClock->now(); - auto waiterResult = startWaiterWithSleepForAndMaxTime( - opCtx.get(), &state, Seconds{10}, startDate + Seconds{60}); // maxTime - ASSERT(stdx::future_status::ready != - waiterResult.wait_for(Milliseconds::zero().toSystemDuration())); - mockClock->advance(Seconds{9}); - ASSERT(stdx::future_status::ready != - waiterResult.wait_for(Milliseconds::zero().toSystemDuration())); - mockClock->advance(Seconds{2}); - ASSERT_FALSE(waiterResult.get()); -} - } // namespace } // namespace mongo |