diff options
author | Cheahuychou Mao <cheahuychou.mao@mongodb.com> | 2019-10-25 15:42:45 +0000 |
---|---|---|
committer | evergreen <evergreen@mongodb.com> | 2019-10-25 15:42:45 +0000 |
commit | f79498e9aa27765fc363fcb85a65f47af6e20ee1 (patch) | |
tree | 6644c44b8faad447f69abdb4adeb32bc292d670d /jstests/core/txns/kill_op_on_txn_expiry.js | |
parent | 232a30488cd016439ab6455193c1f8424014cea2 (diff) | |
download | mongo-f79498e9aa27765fc363fcb85a65f47af6e20ee1.tar.gz |
SERVER-39165 Add waitForFailpoint command and update non-repl tests
Diffstat (limited to 'jstests/core/txns/kill_op_on_txn_expiry.js')
-rw-r--r-- | jstests/core/txns/kill_op_on_txn_expiry.js | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/jstests/core/txns/kill_op_on_txn_expiry.js b/jstests/core/txns/kill_op_on_txn_expiry.js index 49c5c72299c..daabb1048ce 100644 --- a/jstests/core/txns/kill_op_on_txn_expiry.js +++ b/jstests/core/txns/kill_op_on_txn_expiry.js @@ -3,8 +3,9 @@ (function() { "use strict"; -load('jstests/libs/parallelTester.js'); load("jstests/libs/check_log.js"); +load("jstests/libs/fail_point_util.js"); +load('jstests/libs/parallelTester.js'); const dbName = "test"; const collName = "kill_op_on_txn_expiry"; @@ -46,10 +47,8 @@ try { })); jsTestLog("Enabling fail point to block batch inserts"); - assert.commandWorked( - testDB.adminCommand({configureFailPoint: "hangDuringBatchInsert", mode: "alwaysOn"})); - // Clear ramlog so checkLog can't find log messages from previous times this fail point was - // enabled. + let failPoint = configureFailPoint(testDB, "hangDuringBatchInsert"); + // Clear ramlog so checkLog can't find log messages from the previous times this test was run. assert.commandWorked(testDB.adminCommand({clearLog: 'global'})); jsTestLog("Starting insert operation in parallel thread"); @@ -70,15 +69,14 @@ try { workerThread.start(); jsTestLog("Wait for insert to be blocked"); - checkLog.contains(db.getMongo(), "hangDuringBatchInsert fail point enabled"); + failPoint.wait(); jsTestLog("Wait for the transaction to expire"); checkLog.contains(db.getMongo(), "Aborting transaction with txnNumber " + txnNumber); jsTestLog("Disabling fail point to enable insert to proceed and detect that the session " + "has been killed"); - assert.commandWorked( - testDB.adminCommand({configureFailPoint: "hangDuringBatchInsert", mode: "off"})); + failPoint.off(); workerThread.join(); assert(!workerThread.hasFailed()); |