From ae13a0375bb741e1056e2091a3d612a882413cc6 Mon Sep 17 00:00:00 2001 From: Jack Mulrow Date: Mon, 13 Feb 2023 19:12:12 +0000 Subject: SERVER-73949 Join created executor in transaction API unit tests (cherry picked from commit 393506ef23ee030b58c6b3486d64dafc55b84255) --- src/mongo/db/transaction/transaction_api_test.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) 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 -- cgit v1.2.1