summaryrefslogtreecommitdiff
path: root/jstests/replsets/optime.js
diff options
context:
space:
mode:
authorBenety Goh <benety@mongodb.com>2019-03-26 19:32:07 -0400
committerBenety Goh <benety@mongodb.com>2019-03-26 19:32:17 -0400
commit6b5cfecb81da673a973415ada7c318865cf74153 (patch)
tree6bb5d08b7fdf1a439ea29dbed587a2d3eaf2f656 /jstests/replsets/optime.js
parent63f84d788b7fad7333064c3a2546254aad4dcfba (diff)
downloadmongo-6b5cfecb81da673a973415ada7c318865cf74153.tar.gz
SERVER-40347 optime.js waits for durable wall clock times to synchronize across replica set nodes
Diffstat (limited to 'jstests/replsets/optime.js')
-rw-r--r--jstests/replsets/optime.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/jstests/replsets/optime.js b/jstests/replsets/optime.js
index f8cb300fe16..acd72662574 100644
--- a/jstests/replsets/optime.js
+++ b/jstests/replsets/optime.js
@@ -68,7 +68,9 @@ replTest.awaitSecondaryNodes();
const isPersistent = master.getDB('admin').serverStatus().storageEngine.persistent;
// Check initial optimes
-assert(optimesAndWallTimesAreEqual(replTest, isPersistent));
+assert.soon(function() {
+ return optimesAndWallTimesAreEqual(replTest, isPersistent);
+});
var initialInfo = master.getDB('admin').serverStatus({oplog: true}).oplog;
let initialReplStatusInfo = master.getDB('admin').runCommand({replSetGetStatus: 1});
@@ -76,7 +78,9 @@ let initialReplStatusInfo = master.getDB('admin').runCommand({replSetGetStatus:
// latestOptime should be updated, but earliestOptime should be unchanged
var options = {writeConcern: {w: replTest.nodes.length}};
assert.writeOK(master.getDB('test').foo.insert({a: 1}, options));
-assert(optimesAndWallTimesAreEqual(replTest, isPersistent));
+assert.soon(function() {
+ return optimesAndWallTimesAreEqual(replTest, isPersistent);
+});
var info = master.getDB('admin').serverStatus({oplog: true}).oplog;
let replStatusInfo = master.getDB('admin').runCommand({replSetGetStatus: 1});