diff options
author | Jack Mulrow <jack.mulrow@mongodb.com> | 2023-02-13 19:12:12 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2023-02-14 02:40:18 +0000 |
commit | 393506ef23ee030b58c6b3486d64dafc55b84255 (patch) | |
tree | 30579a975a55d67197b7ca1a6758446221b3ce11 | |
parent | 035ba8def8065ad6e5e27cde7a160431968a7fdc (diff) | |
download | mongo-393506ef23ee030b58c6b3486d64dafc55b84255.tar.gz |
SERVER-73949 Join created executor in transaction API unit tests
-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 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 |