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

    • Fully Compatible
    • v4.4
    • Sharding 2020-10-19
    • 0

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

      Unable to find source-code formatter for language: diff. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      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"
      

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

              Created:
              Updated:
              Resolved: