From 8fc28f0773ca1efb0a43cc5590b9ca8b9e50559e Mon Sep 17 00:00:00 2001 From: Cheahuychou Mao Date: Fri, 25 Oct 2019 19:08:50 +0000 Subject: SERVER-39165 Add waitForFailpoint command and update other repl tests --- .../replsets/kill_reads_with_prepare_conflicts_during_step_down.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'jstests/replsets/kill_reads_with_prepare_conflicts_during_step_down.js') diff --git a/jstests/replsets/kill_reads_with_prepare_conflicts_during_step_down.js b/jstests/replsets/kill_reads_with_prepare_conflicts_during_step_down.js index 016f05fd5ea..56f46b58155 100644 --- a/jstests/replsets/kill_reads_with_prepare_conflicts_during_step_down.js +++ b/jstests/replsets/kill_reads_with_prepare_conflicts_during_step_down.js @@ -9,7 +9,7 @@ "use strict"; load("jstests/core/txns/libs/prepare_helpers.js"); -load("jstests/libs/check_log.js"); +load("jstests/libs/fail_point_util.js"); // Start one of the nodes with priority: 0 to avoid elections. const rst = new ReplSetTest({nodes: [{}, {rsConfig: {priority: 0}}]}); @@ -32,8 +32,7 @@ const sessionID = session.getSessionId(); let sessionDB = session.getDatabase(dbName); const sessionColl = sessionDB.getCollection(collName); -assert.commandWorked( - primaryAdmin.adminCommand({configureFailPoint: "WTPrintPrepareConflictLog", mode: "alwaysOn"})); +let failPoint = configureFailPoint(primaryAdmin, "WTPrintPrepareConflictLog"); // Insert a document that we will later modify in a transaction. assert.commandWorked(primaryColl.insert({_id: 1})); @@ -70,7 +69,7 @@ const readBlockedOnPrepareConflictThread = startParallelShell(() => { }, primary.port); jsTestLog("Waiting for failpoint"); -checkLog.contains(primary, "WTPrintPrepareConflictLog fail point enabled"); +failPoint.wait(); // Once we have confirmed that the find command has hit a prepare conflict, we can perform // a step down. -- cgit v1.2.1