summaryrefslogtreecommitdiff
path: root/jstests
diff options
context:
space:
mode:
authorBenety Goh <benety@mongodb.com>2016-07-06 13:39:48 -0400
committerJudah Schvimer <judah@mongodb.com>2016-09-06 10:08:58 -0400
commit0dda3d3401e7d1075fe1fdc90f629968d9c8a35d (patch)
treeddd0f431338fc9f4925530480e1d7cbcb23730f7 /jstests
parent9f4ee281fb0f2a0840e2b1ae5fd875bee2587ee1 (diff)
downloadmongo-0dda3d3401e7d1075fe1fdc90f629968d9c8a35d.tar.gz
SERVER-24926 ensure replication in replset8.js is caught up after update to check collection size
(cherry picked from commit 91ab93c35b63a182fa71c5fe6c1e5c77e1bddea4)
Diffstat (limited to 'jstests')
-rw-r--r--jstests/replsets/replset8.js9
1 files changed, 3 insertions, 6 deletions
diff --git a/jstests/replsets/replset8.js b/jstests/replsets/replset8.js
index 77a7c26763f..4f0a54cadb2 100644
--- a/jstests/replsets/replset8.js
+++ b/jstests/replsets/replset8.js
@@ -47,18 +47,15 @@ assert.writeOK(bulk.execute());
var slave = rt.add();
rt.reInitiate();
print("initiation complete!");
-var sc = slave.getDB('d')['c'];
-slave.setSlaveOk();
-sleep(25000);
+rt.awaitSecondaryNodes();
print("updating documents backwards");
// Move all documents to the beginning by growing them to sizes that should
// fit the holes we made in phase 1
bulk = mdc.initializeUnorderedBulkOp();
for (i = doccount * 2; i > doccount; --i) {
- mdc.update({_id: i, x: i}, {_id: i, x: bigstring});
+ bulk.find({_id: i, x: i}).update({$set: {x: bigstring}});
bigstring = bigstring.slice(0, -1); // remove last char
}
+assert.writeOK(bulk.execute({writeConcern: {w: rt.nodes.length}}));
print("finished");
-// Wait for replication to catch up.
-rt.awaitSecondaryNodes();
assert.eq(doccount + 1, slave.getDB('d')['c'].find().itcount());