diff options
author | Samy Lanka <samy.lanka@mongodb.com> | 2022-04-01 18:50:51 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-04-28 19:45:51 +0000 |
commit | 42262744dc0df2025aec66d10b3e34c38448db91 (patch) | |
tree | c1f704b9193e8900e51ff8c847465a364350c882 | |
parent | 2205c918e0dc4c5bd9b3e7151c42316792293aae (diff) | |
download | mongo-42262744dc0df2025aec66d10b3e34c38448db91.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)
-rw-r--r-- | jstests/replsets/abort_in_progress_transactions_on_step_up.js | 9 |
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 e58ede11577..669b5d81146 100644 --- a/jstests/replsets/abort_in_progress_transactions_on_step_up.js +++ b/jstests/replsets/abort_in_progress_transactions_on_step_up.js @@ -79,8 +79,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); |