summaryrefslogtreecommitdiff
path: root/jstests/replsets/initial_sync1.js
diff options
context:
space:
mode:
authorKristina <kristina@10gen.com>2011-11-09 18:45:29 -0500
committerKristina <kristina@10gen.com>2011-11-09 18:45:57 -0500
commit72dcc0b296306fc432f52ada8eedf4814c791b68 (patch)
tree7f277c562698e54ff16753a704dcac47db48a2a6 /jstests/replsets/initial_sync1.js
parentf2d426df7031ea8aa85ae967b9165851507dcd31 (diff)
downloadmongo-72dcc0b296306fc432f52ada8eedf4814c791b68.tar.gz
Allow background indexes while in secondary state SERVER-2771
Diffstat (limited to 'jstests/replsets/initial_sync1.js')
-rw-r--r--jstests/replsets/initial_sync1.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/jstests/replsets/initial_sync1.js b/jstests/replsets/initial_sync1.js
index 4cfd606ec9c..ba6e45d25fe 100644
--- a/jstests/replsets/initial_sync1.js
+++ b/jstests/replsets/initial_sync1.js
@@ -116,10 +116,17 @@ wait(function() {
print("10. Insert some stuff");
master = replTest.getMaster();
for (var i=0; i<10000; i++) {
- foo.bar.insert({date : new Date(), x : i, str : "all the talk on the market"});
+ master.getDB("foo").bar.insert({date : new Date(), x : i, str : "all the talk on the market"});
}
print("11. Everyone happy eventually");
replTest.awaitReplication(300000);
+
+print("12. Build index in background");
+master.getDB("foo").bar.ensureIndex({x : 1}, {background : true});
+
+assert.soon(function() {
+ return replTest.liveNodes.slaves[0].getDB("foo").runCommand({count: 1}).ok == 1;
+});