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-29 14:53:08 +0000
commit8301052733a5edccc33e1f15cf54004117f56ee9 (patch)
tree4ff7e32a08e843ad4963c963ce9d4db87a3a80f3
parent7706878536b0079250a219cc96ae09a1cb5e9492 (diff)
downloadmongo-8301052733a5edccc33e1f15cf54004117f56ee9.tar.gz
SERVER-65166 Use compareOptimes in abort_in_progress_transactions_on_step_up.js
(cherry picked from commit e2bf96ccc04299feee022ee4fcdb0b6d6a0769d4) (cherry picked from commit bfad9016db54c0cd5a12247abf01db3be81dcce2) (cherry picked from commit 42262744dc0df2025aec66d10b3e34c38448db91)
-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 31300d40628..dfb1f3b67e5 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.");
checkLog.contains(newPrimary, "stopReplProducerOnDocument fail point is enabled.");
-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);