summaryrefslogtreecommitdiff
path: root/jstests
diff options
context:
space:
mode:
authorSpencer T Brody <spencer@mongodb.com>2017-04-21 14:56:49 -0400
committerSpencer T Brody <spencer@mongodb.com>2017-06-16 13:51:47 -0400
commit95d108fe848d3dbea4ca020739430e0672a4dedd (patch)
treeb3075537cff8b4959b62f7fc3d580fe5dbca8a6b /jstests
parent6a8fb8cd6468735dfeedfd61d1c48299f3732bb9 (diff)
downloadmongo-95d108fe848d3dbea4ca020739430e0672a4dedd.tar.gz
SERVER-28186 Increase slaveDelay in repl10.js test
(cherry picked from commit 4171efb989ba2b7d5d1d1d77a76840a7a155d571)
Diffstat (limited to 'jstests')
-rw-r--r--jstests/master_slave/repl10.js57
1 files changed, 30 insertions, 27 deletions
diff --git a/jstests/master_slave/repl10.js b/jstests/master_slave/repl10.js
index dfe3aab9fbf..af55a56b01b 100644
--- a/jstests/master_slave/repl10.js
+++ b/jstests/master_slave/repl10.js
@@ -1,40 +1,43 @@
// Test slave delay
+(function() {
+ "use strict";
-var baseName = "jstests_repl10test";
+ var baseName = "jstests_repl10test";
-soonCount = function(count) {
- assert.soon(function() {
- // print( "check count" );
- // print( "count: " + s.getDB( baseName ).z.find().count() );
- return s.getDB(baseName).a.find().count() == count;
- });
-};
+ var soonCount = function(s, count) {
+ assert.soon(function() {
+ // print( "check count" );
+ // print( "count: " + s.getDB( baseName ).z.find().count() );
+ return s.getDB(baseName).a.find().count() == count;
+ });
+ };
-doTest = function(signal) {
+ var doTest = function(signal) {
- rt = new ReplTest("repl10tests");
+ var rt = new ReplTest("repl10tests");
- m = rt.start(true);
- s = rt.start(false, {"slavedelay": "10"});
+ var m = rt.start(true);
+ var s = rt.start(false, {"slavedelay": "30"});
- am = m.getDB(baseName).a;
+ var am = m.getDB(baseName).a;
- am.save({i: 1});
+ am.save({i: 1});
- soonCount(1);
+ soonCount(s, 1);
- am.save({i: 2});
- assert.eq(2, am.count());
- sleep(3000);
- assert.eq(1, s.getDB(baseName).a.count());
+ am.save({i: 2});
+ assert.eq(2, am.count());
+ sleep(2000);
+ assert.eq(1, s.getDB(baseName).a.count());
- soonCount(2);
+ soonCount(s, 2);
- rt.stop();
-};
+ rt.stop();
+ };
-print("repl10.js dotest(15)");
-doTest(15); // SIGTERM
-print("repl10.js dotest(15)");
-doTest(9); // SIGKILL
-print("repl10.js SUCCESS");
+ print("repl10.js dotest(15)");
+ doTest(15); // SIGTERM
+ print("repl10.js dotest(15)");
+ doTest(9); // SIGKILL
+ print("repl10.js SUCCESS");
+}()); \ No newline at end of file