summaryrefslogtreecommitdiff
path: root/src/mongo/db/operation_context_test.cpp
diff options
context:
space:
mode:
authorLucas de Castro Borges <lucas@gnuabordo.com.br>2025-02-11 15:07:35 -0300
committerLucas de Castro Borges <lucas@gnuabordo.com.br>2025-02-11 15:07:35 -0300
commit4cb8841196d0625dfa3825aa326f071cd27c7b8b (patch)
tree1682a647d4463397c119183369ae6f750d5fdcff /src/mongo/db/operation_context_test.cpp
parentaa03c6362cbaa767638e6eed9b031d86dd2643d1 (diff)
parent8f0827553e09872941945a093b647a4211a9db7f (diff)
Update upstream source from tag 'upstream/6.0.0'master
Update to upstream version '6.0.0' with Debian dir 5604a80ec1c96ca76f25f40d78e6ef855abec322
Diffstat (limited to 'src/mongo/db/operation_context_test.cpp')
-rw-r--r--src/mongo/db/operation_context_test.cpp17
1 files changed, 2 insertions, 15 deletions
diff --git a/src/mongo/db/operation_context_test.cpp b/src/mongo/db/operation_context_test.cpp
index f25176eda4f..825afda8cae 100644
--- a/src/mongo/db/operation_context_test.cpp
+++ b/src/mongo/db/operation_context_test.cpp
@@ -1063,19 +1063,16 @@ TEST_F(ThreadedOperationDeadlineTests, SleepForWithExpiredForDoesNotBlock) {
}
TEST(OperationContextTest, TestWaitForConditionOrInterruptUntilAPI) {
- // `waitForConditionOrInterruptUntil` can have four outcomes:
+ // `waitForConditionOrInterruptUntil` can have three outcomes:
//
// 1) The condition is satisfied before any timeouts.
// 2) The explicit `deadline` function argument is triggered.
// 3) The operation context implicitly times out, or is interrupted from a killOp command or
// shutdown, etc.
- // 4) The deadline supplied may overflow the conversion to the system clock's resolution, from
- // milliseconds to nanoseconds. This will not cancel the opCtx.
//
// Case (1) must return true.
// Case (2) must return false.
- // Case (3) must throw a MaxTimeMSExpired DBException.
- // Case (4) must throw a DurationOverflow DBException.
+ // Case (3) must throw a DBException.
//
// Case (1) is the hardest to test. The condition variable must be notified by a second thread
// when the client is waiting on it. Case (1) is also the least in need of having the API
@@ -1102,16 +1099,6 @@ TEST(OperationContextTest, TestWaitForConditionOrInterruptUntilAPI) {
DBException,
ErrorCodes::MaxTimeMSExpired);
ASSERT_TRUE(opCtx->getCancellationToken().isCanceled());
-
- // Case (4). Expect an error of 'DurationOverflow'.
- auto secondClient = serviceCtx->makeClient("OperationContextTest");
- auto secondOpCtx = secondClient->makeOperationContext();
- deadline = Date_t::max() - Milliseconds(1);
- ASSERT_THROWS_CODE(
- secondOpCtx->waitForConditionOrInterruptUntil(cv, lk, deadline, [] { return false; }),
- DBException,
- ErrorCodes::DurationOverflow);
- ASSERT_FALSE(secondOpCtx->getCancellationToken().isCanceled());
}
TEST(OperationContextTest, TestIsWaitingForConditionOrInterrupt) {