diff options
-rw-r--r-- | src/mongo/db/transaction/transaction_api_test.cpp | 8 |
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 453045dbafa..b45831150ad 100644 --- a/src/mongo/db/transaction/transaction_api_test.cpp +++ b/src/mongo/db/transaction/transaction_api_test.cpp @@ -2328,6 +2328,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) { @@ -2395,6 +2399,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 |