Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-51673

Fix test case in transaction_coordinator_test to shut down AsyncWorkScheduler before attempting to persist decision

    XMLWordPrintable

    Details

    • Backwards Compatibility:
      Fully Compatible
    • Backport Requested:
      v4.4
    • Sprint:
      Sharding 2020-10-19
    • Linked BF Score:
      0

      Description

      The PersistCommitDecisionWhenNoDocumentForTransactionExistsCanBeInterruptedAndReturnsError test case fails due to decision being persistent before txn::AsyncWorkScheduler is shut down.

      diff --git a/src/mongo/db/s/transaction_coordinator_test.cpp b/src/mongo/db/s/transaction_coordinator_test.cpp
      index e7426e97de..d962ffb622 100644
      --- a/src/mongo/db/s/transaction_coordinator_test.cpp
      +++ b/src/mongo/db/s/transaction_coordinator_test.cpp
      @@ -724,6 +724,7 @@ TEST_F(TransactionCoordinatorDriverPersistenceTest,
                   decision.setCommitTimestamp(_commitTimestamp);
                   return decision;
               }());
      +    sleepmillis(500);
           _aws->shutdown({ErrorCodes::TransactionCoordinatorSteppingDown, "Shutdown for test"});
       
           ASSERT_THROWS_CODE(
      

      {"t":{"$date":"2020-10-15T19:28:25.165Z"},"s":"I",  "c":"TEST",     "id":4680100, "ctx":"main","msg":"FAIL","attr":{"test":"PersistCommitDecisionWhenNoDocumentForTransactionExistsCanBeInterruptedAndReturnsError","type":"TestAssertionFailureException","error":"Expected expression future.get() to throw AssertionException but it threw nothing. @src/mongo/db/s/transaction_coordinator_test.cpp:731"
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              max.hirschhorn Max Hirschhorn
              Reporter:
              max.hirschhorn Max Hirschhorn
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: