summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mongo/db/transaction/transaction_api_test.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mongo/db/transaction/transaction_api_test.cpp b/src/mongo/db/transaction/transaction_api_test.cpp
index fbaedc67e5a..8cb3ff879d1 100644
--- a/src/mongo/db/transaction/transaction_api_test.cpp
+++ b/src/mongo/db/transaction/transaction_api_test.cpp
@@ -2332,6 +2332,10 @@ TEST_F(TxnAPITest, WaitsForBestEffortAbortOnNonTransientErrorIfNotCancelled) {
// After the abort finishes, the API should not have retried.
expectSentAbort(1 /* txnNumber */, WriteConcernOptions().toBSON());
+
+ // Wait for tasks so destructors run on the main test thread.
+ executor->shutdown();
+ executor->join();
}
TEST_F(TxnAPITest, WaitsForBestEffortAbortOnTransientError) {
@@ -2399,6 +2403,10 @@ TEST_F(TxnAPITest, WaitsForBestEffortAbortOnTransientError) {
boost::none /* readConcern */,
WriteConcernOptions().toBSON() /* writeConcern */);
ASSERT_EQ(lastRequest.firstElementFieldNameStringData(), "commitTransaction"_sd);
+
+ // Wait for tasks so destructors run on the main test thread.
+ executor->shutdown();
+ executor->join();
}
} // namespace