summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJudah Schvimer <judah@mongodb.com>2015-12-08 14:36:03 -0500
committerJudah Schvimer <judah@mongodb.com>2015-12-08 14:36:03 -0500
commitcbc1e9ac8711096e0e87207303e5d0cabceb5040 (patch)
tree47fab4e2b14bd8dd41f021b5b7ce6aec95a68a60
parent6e188a409406d9066ce5edd1927caa77e734f3d1 (diff)
downloadmongo-cbc1e9ac8711096e0e87207303e5d0cabceb5040.tar.gz
TOOLS-1002 Makes oplog_rollover_test wait longer to trigger oplog rollovers more consistently
-rw-r--r--test/qa-tests/jstests/dump/oplog_rollover_test.js18
1 files changed, 9 insertions, 9 deletions
diff --git a/test/qa-tests/jstests/dump/oplog_rollover_test.js b/test/qa-tests/jstests/dump/oplog_rollover_test.js
index 187bdc3162d..da8b2423e22 100644
--- a/test/qa-tests/jstests/dump/oplog_rollover_test.js
+++ b/test/qa-tests/jstests/dump/oplog_rollover_test.js
@@ -31,15 +31,15 @@ if (typeof getToolTest === 'undefined') {
' db.getSiblingDB(\'foo\').bar.insert({ x: longString }); ' +
'}');
- // Give some time for inserts to actually start before dumping, we only need
- // one document to go in and 0.5 seconds should be enough unless your
- // scheduler is wonky or your HDD is really slow.
- sleep(2000);
-
- var countBeforeMongodump = db.bar.count();
- // Crash if parallel shell hasn't started inserting yet
- assert.gt(countBeforeMongodump, 0, 'Didn\'t successfully start inserting ' +
- 'large documents before mongodump');
+ // Give some time for inserts to actually start before dumping. In order for
+ // an oplog rollover to occur we need many documents to already be inserted. If the
+ // delay below is not long enough to trigger an oplog rollover, then increase the
+ // required document count.
+ var i = 0;
+ while (db.bar.count() < 175) {
+ assert.lt(i++, 120, 'Took longer than 120 seconds to insert 175 documents before mongodump.');
+ sleep(1000);
+ }
var dumpArgs = ['dump', '--oplog'].concat(getDumpTarget()).
concat(getDumpTarget()).