summaryrefslogtreecommitdiff
path: root/src/mongo/db/operation_context_test.cpp
diff options
context:
space:
mode:
authorAndy Schwerin <Andy Schwerin schwerin@mongodb.com>2017-03-15 13:46:16 -0400
committerAndy Schwerin <Andy Schwerin schwerin@mongodb.com>2017-03-15 13:46:16 -0400
commitb9827dcc65c15eae2b863b9a0a60a9864ba3f98b (patch)
tree854a86b8d9e4adc1d0f51e0d3143d37ca3be9798 /src/mongo/db/operation_context_test.cpp
parent1515d4e4e2613e79b2c1761b7505cfaa9c31f0a9 (diff)
downloadmongo-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/mongo/db/operation_context_test.cpp')
-rw-r--r--src/mongo/db/operation_context_test.cpp15
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