diff options
author | Dan Pasette <dan@10gen.com> | 2015-03-10 11:49:12 -0400 |
---|---|---|
committer | Dan Pasette <dan@mongodb.com> | 2015-03-10 11:50:35 -0400 |
commit | a1da51e735e050a2a7cf4806d5e5e133a5d16d9d (patch) | |
tree | 28addaffc8c4c72b330ab9f1b6a60cc95b5689fb | |
parent | 37fd2853903bf26384a31a0d81e8d5a89546648e (diff) | |
download | mongo-a1da51e735e050a2a7cf4806d5e5e133a5d16d9d.tar.gz |
SERVER-17487 warn in lieu of assert in initial_sync_cloner_dups.js in case of false positive
(cherry picked from commit a52d13a43e40f6ff7e486cee943fe7feda87d59e)
-rw-r--r-- | jstests/noPassthrough/initial_sync_cloner_dups.js | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/jstests/noPassthrough/initial_sync_cloner_dups.js b/jstests/noPassthrough/initial_sync_cloner_dups.js index 4527ca3fcad..27ebc4160c6 100644 --- a/jstests/noPassthrough/initial_sync_cloner_dups.js +++ b/jstests/noPassthrough/initial_sync_cloner_dups.js @@ -47,13 +47,11 @@ replTest.awaitReplication(); jsTestLog("Start remove/insert on primary"); var insertAndRemove = function(host) { + jsTestLog("starting bg writes on " + host); var m = new Mongo(host); var db = m.getDB('test'); var coll = db.cloner; var numDocs = coll.count(); - - jsTestLog("starting bg writes on " + host); - for (var i=0; !db.stop.findOne(); i++) { var id = Random.randInt(numDocs); coll.remove({_id: id}); @@ -76,12 +74,15 @@ replTest.reInitiate(); secondary.setSlaveOk(); // NOTE: This is here to prevent false negatives, but it is racy and dependent on magic numbers. -// If this fails, consider retying or removing. +// Removed the assertion because it was too flaky. Printing a warning instead (dan) jsTestLog("making sure we dropped some dups"); var res = secondary.adminCommand({getLog:"global"}); -assert(contains(res.log, function(v) { +var droppedDups = (contains(res.log, function(v) { return v.indexOf("index build dropped"/* NNN dups*/) != -1; })); +if (!droppedDups) { + jsTestLog("Warning: Test did not trigger duplicate documents, this run will be a false negative"); +} jsTestLog("stoping writes and waiting for replica set to coalesce") primary.getDB('test').stop.insert({}); |