summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mongo/s/write_ops/batch_write_exec_test.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mongo/s/write_ops/batch_write_exec_test.cpp b/src/mongo/s/write_ops/batch_write_exec_test.cpp
index 2703ff58e8e..61745ac4d64 100644
--- a/src/mongo/s/write_ops/batch_write_exec_test.cpp
+++ b/src/mongo/s/write_ops/batch_write_exec_test.cpp
@@ -2004,6 +2004,11 @@ TEST_F(BatchWriteExecTransactionMultiShardTest, TargetedSucceededAndErrorRespons
});
future.default_timed_get();
+
+ // It is expected that the transaction will leave the request of Shard2 without processing, so,
+ // the baton is manually run because there is no other blocking call on the operation context,
+ // making the cleanup as scheduled by the destructor of MultiStatementTransactionRequestsSender.
+ operationContext()->getBaton()->run(getServiceContext()->getPreciseClockSource());
}
/**