summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamy Lanka <samy.lanka@mongodb.com>2022-04-01 18:50:51 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-04-28 14:50:07 +0000
commitbfad9016db54c0cd5a12247abf01db3be81dcce2 (patch)
treeb5e3e0d7b9128ba0837b9e32d548ff94df3e15b3
parentc997350d15e372d75528a1d65694242ed53833ee (diff)
downloadmongo-bfad9016db54c0cd5a12247abf01db3be81dcce2.tar.gz
SERVER-65166 Use compareOptimes in abort_in_progress_transactions_on_step_up.js
(cherry picked from commit e2bf96ccc04299feee022ee4fcdb0b6d6a0769d4)
-rw-r--r--jstests/replsets/abort_in_progress_transactions_on_step_up.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/jstests/replsets/abort_in_progress_transactions_on_step_up.js b/jstests/replsets/abort_in_progress_transactions_on_step_up.js
index 5e579056df5..73fd930a08b 100644
--- a/jstests/replsets/abort_in_progress_transactions_on_step_up.js
+++ b/jstests/replsets/abort_in_progress_transactions_on_step_up.js
@@ -82,8 +82,13 @@ const startOpTime = testDB.getSiblingDB("local").oplog.rs.findOne({ts: commitOpT
jsTestLog("Wait for the new primary to block on fail point.");
stopReplProducerOnDocumentFailPoint.wait();
-jsTestLog("Wait for the new primary to apply the first op of transaction.");
-assert.soon(() => getLastOpTime(newPrimary) >= startOpTime);
+jsTestLog("Wait for the new primary to apply the first op of transaction at timestamp: " +
+ tojson(startOpTime));
+assert.soon(() => {
+ const lastOpTime = getLastOpTime(newPrimary);
+ jsTestLog("Current lastOpTime on the new primary: " + tojson(lastOpTime));
+ return rs.compareOpTimes(lastOpTime, startOpTime) >= 0;
+});
// Now the transaction should be in-progress on newPrimary.
txnTableEntry = getTxnTableEntry(newTestDB);