summaryrefslogtreecommitdiff
path: root/jstests/replsets/optime.js
diff options
context:
space:
mode:
authorDaniel Gottlieb <daniel.gottlieb@mongodb.com>2018-03-24 19:39:13 -0400
committerDaniel Gottlieb <daniel.gottlieb@mongodb.com>2018-03-24 19:39:13 -0400
commit6ae04cd9f250fac877df94ecd4ddad33eaf5bc77 (patch)
tree79b85cf7e081ca012ac0a0a75c728f5e1942b891 /jstests/replsets/optime.js
parentb06203cf7b99d582b2be211f2e8fc5bbca8f3263 (diff)
downloadmongo-6ae04cd9f250fac877df94ecd4ddad33eaf5bc77.tar.gz
SERVER-29213: Have WiredTiger support recoverToStableTimestamp.
Diffstat (limited to 'jstests/replsets/optime.js')
-rw-r--r--jstests/replsets/optime.js16
1 files changed, 11 insertions, 5 deletions
diff --git a/jstests/replsets/optime.js b/jstests/replsets/optime.js
index 862dc1eb2ca..ee0e30ac7d6 100644
--- a/jstests/replsets/optime.js
+++ b/jstests/replsets/optime.js
@@ -32,7 +32,10 @@ function optimesAreEqual(replTest) {
return true;
}
-var replTest = new ReplSetTest({name: "replStatus", nodes: 3, oplogSize: 1, waitForKeys: true});
+// This test has a part that rolls over the oplog. Doing so requires a fresh stable
+// checkpoint. Set the syncdelay to a small value to increase checkpoint frequency.
+var replTest = new ReplSetTest(
+ {name: "replStatus", nodes: 3, oplogSize: 1, waitForKeys: true, nodeOptions: {syncdelay: 1}});
replTest.startSet();
replTest.initiate();
@@ -63,9 +66,12 @@ assert.soon(function() {
return optimesAreEqual(replTest);
});
-// Test that earliestOptime was updated
-info = master.getDB('admin').serverStatus({oplog: true}).oplog;
-assert.gt(timestampCompare(info.latestOptime, initialInfo.latestOptime), 0);
-assert.gt(timestampCompare(info.earliestOptime, initialInfo.earliestOptime), 0);
+// This block requires a fresh stable checkpoint.
+assert.soon(function() {
+ // Test that earliestOptime was updated
+ info = master.getDB('admin').serverStatus({oplog: true}).oplog;
+ return timestampCompare(info.latestOptime, initialInfo.latestOptime) > 0 &&
+ timestampCompare(info.earliestOptime, initialInfo.earliestOptime) > 0;
+});
replTest.stopSet();