summaryrefslogtreecommitdiff
path: root/jstests/repl
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/repl')
-rw-r--r--jstests/repl/pair1.js6
-rw-r--r--jstests/repl/pair2.js3
-rw-r--r--jstests/repl/repl1.js5
-rw-r--r--jstests/repl/repl2.js3
-rw-r--r--jstests/repl/repl3.js5
-rw-r--r--jstests/repl/repl5.js3
-rw-r--r--jstests/repl/repl6.js6
-rw-r--r--jstests/repl/repl7.js6
-rw-r--r--jstests/repl/replacePeer1.js6
-rw-r--r--jstests/repl/replacePeer2.js5
10 files changed, 26 insertions, 22 deletions
diff --git a/jstests/repl/pair1.js b/jstests/repl/pair1.js
index 292995a771c..e9c8bec74cc 100644
--- a/jstests/repl/pair1.js
+++ b/jstests/repl/pair1.js
@@ -77,7 +77,6 @@ doTest = function( signal ) {
checkWrite( r, l );
stopMongod( ports[ 2 ], signal );
- sleep( 2000 );
assert.soon( function() {
lm = ismaster( l );
@@ -101,7 +100,6 @@ doTest = function( signal ) {
checkWrite( l, r );
stopMongod( ports[ 1 ], signal );
- sleep( 2000 );
assert.soon( function() {
rm = ismaster( r );
@@ -122,7 +120,9 @@ doTest = function( signal ) {
} );
checkWrite( r, l );
-
+
+ ports.forEach( function( x ) { stopMongod( x ); } );
+
}
doTest( 15 ); // SIGTERM
diff --git a/jstests/repl/pair2.js b/jstests/repl/pair2.js
index fc0f9651a5e..9db915c84b2 100644
--- a/jstests/repl/pair2.js
+++ b/jstests/repl/pair2.js
@@ -40,7 +40,6 @@ doTest = function( signal ) {
assert.eq( 0, l.getDB( "admin" ).runCommand( { "resync" : 1 } ).ok );
stopMongod( ports[ 1 ], signal );
- sleep( 2000 );
big = new Array( 2000 ).toString();
for( i = 0; i < 1000; ++i )
@@ -58,6 +57,8 @@ doTest = function( signal ) {
assert.eq( 0, l.getDB( "admin" ).runCommand( { "resync" : 1 } ).ok );
+ ports.forEach( function( x ) { stopMongod( x ); } );
+
}
doTest( 15 ); // SIGTERM
diff --git a/jstests/repl/repl1.js b/jstests/repl/repl1.js
index 455b29baa0d..df1e60c8b02 100644
--- a/jstests/repl/repl1.js
+++ b/jstests/repl/repl1.js
@@ -33,7 +33,6 @@ doTest = function( signal ) {
assert.eq( 1, as.find( { i: 999 } ).count() );
stopMongod( ports[ 1 ], signal );
- sleep( 2000 );
for( i = 1000; i < 1010; ++i )
am.save( { _id: new ObjectId(), i: i } );
@@ -44,7 +43,6 @@ doTest = function( signal ) {
assert.eq( 1, as.find( { i: 1009 } ).count() );
stopMongod( ports[ 0 ], signal );
- sleep( 2000 );
m = startMongoProgram( "mongod", "--port", ports[ 0 ], "--dbpath", "/data/db/" + baseName + "-master", "--master", "--oplogSize", "1" );
am = m.getDB( baseName ).a
@@ -54,7 +52,8 @@ doTest = function( signal ) {
assert.soon( function() { return as.find().count() == 1020; } );
assert.eq( 1, as.find( { i: 1019 } ).count() );
-
+
+ ports.forEach( function( x ) { stopMongod( x ); } );
}
doTest( 15 ); // SIGTERM
diff --git a/jstests/repl/repl2.js b/jstests/repl/repl2.js
index 98c14dbab14..347492667a1 100644
--- a/jstests/repl/repl2.js
+++ b/jstests/repl/repl2.js
@@ -28,7 +28,6 @@ doTest = function( signal ) {
soonCount( 1 );
assert.eq( 0, s.getDB( "admin" ).runCommand( { "resync" : 1 } ).ok );
stopMongod( ports[ 1 ], signal );
- sleep( 2000 );
big = new Array( 2000 ).toString();
for( i = 0; i < 1000; ++i )
@@ -45,6 +44,8 @@ doTest = function( signal ) {
assert.eq( 0, s.getDB( "admin" ).runCommand( { "resync" : 1 } ).ok );
+ ports.forEach( function( x ) { stopMongod( x ); } );
+
}
doTest( 15 ); // SIGTERM
diff --git a/jstests/repl/repl3.js b/jstests/repl/repl3.js
index 9627c14e951..dfee2bb9498 100644
--- a/jstests/repl/repl3.js
+++ b/jstests/repl/repl3.js
@@ -27,7 +27,6 @@ doTest = function( signal ) {
am.save( { _id: new ObjectId() } );
soonCount( 1 );
stopMongod( ports[ 1 ], signal );
- sleep( 2000 );
big = new Array( 2000 ).toString();
for( i = 0; i < 1000; ++i )
@@ -48,7 +47,9 @@ doTest = function( signal ) {
assert.eq( 1, as.find( { i: 999 } ).count() );
assert.eq( 0, s.getDB( "admin" ).runCommand( { "resync" : 1 } ).ok );
-
+
+ ports.forEach( function( x ) { stopMongod( x ); } );
+
}
doTest( 15 ); // SIGTERM
diff --git a/jstests/repl/repl5.js b/jstests/repl/repl5.js
index 53346ce0d46..edb34a0e3e3 100644
--- a/jstests/repl/repl5.js
+++ b/jstests/repl/repl5.js
@@ -26,7 +26,6 @@ doTest = function( signal ) {
s = startMongod( "--port", ports[ 1 ], "--dbpath", "/data/db/" + baseName + "-slave", "--slave", "--source", "127.0.0.1:" + ports[ 0 ] );
soonCountAtLeast( "a", "a", 1 );
stopMongod( ports[ 1 ], signal );
- sleep( 2000 );
s = startMongoProgram( "mongod", "--port", ports[ 1 ], "--dbpath", "/data/db/" + baseName + "-slave", "--slave", "--source", "127.0.0.1:" + ports[ 0 ] );
sleep( 1000 );
@@ -35,6 +34,8 @@ doTest = function( signal ) {
ma.save( { i:-2 } );
soonCountAtLeast( "a", "a", 10002 );
+ ports.forEach( function( x ) { stopMongod( x ); } );
+
}
doTest( 15 ); // SIGTERM
diff --git a/jstests/repl/repl6.js b/jstests/repl/repl6.js
index 2f368042d04..53a7425db51 100644
--- a/jstests/repl/repl6.js
+++ b/jstests/repl/repl6.js
@@ -43,7 +43,6 @@ doTest = function( signal ) {
stopMongod( ports[ 1 ], signal );
stopMongod( ports[ 2 ], signal );
- sleep( 2000 );
for( i = 1000; i < 1010; ++i )
am.save( { _id: new ObjectId(), i: i } );
@@ -54,7 +53,6 @@ doTest = function( signal ) {
assert.eq( 1, as.find( { i: 1009 } ).count() );
stopMongod( ports[ 0 ], signal );
- sleep( 2000 );
m = startMongoProgram( "mongod", "--port", ports[ 0 ], "--dbpath", "/data/db/" + baseName + "-master", "--master", "--oplogSize", "1" );
am = m.getDB( baseName ).a
@@ -70,7 +68,9 @@ doTest = function( signal ) {
as = s2.getDB( baseName ).a
assert.eq( 1, as.find( { i: 1009 } ).count() );
assert.eq( 1, as.find( { i: 1019 } ).count() );
-
+
+ ports.forEach( function( x ) { stopMongod( x ); } );
+
}
doTest( 15 ); // SIGTERM
diff --git a/jstests/repl/repl7.js b/jstests/repl/repl7.js
index d3bf83e0298..06ae08cac0e 100644
--- a/jstests/repl/repl7.js
+++ b/jstests/repl/repl7.js
@@ -21,8 +21,6 @@ doTest = function( signal ) {
stopMongod( ports[ 1 ], signal );
- sleep( 4000 );
-
s = startMongoProgram( "mongod", "--port", ports[ 1 ], "--dbpath", "/data/db/" + baseName + "-slave", "--slave", "--source", "127.0.0.1:" + ports[ 0 ] );
assert.soon( function() {
@@ -36,7 +34,9 @@ doTest = function( signal ) {
for( n = "a"; n != "aaaaa"; n += "a" ) {
assert.eq( 1, m.getDB( n ).a.find().count() );
}
-
+
+ ports.forEach( function( x ) { stopMongod( x ); } );
+
}
doTest( 15 ); // SIGTERM
diff --git a/jstests/repl/replacePeer1.js b/jstests/repl/replacePeer1.js
index c21ccd28680..537c08241fe 100644
--- a/jstests/repl/replacePeer1.js
+++ b/jstests/repl/replacePeer1.js
@@ -56,14 +56,12 @@ doTest = function( signal ) {
checkWrite( r, l );
stopMongod( ports[ 1 ], signal );
- sleep( 2000 );
writeOne( r );
assert.eq( 1, r.getDB( "admin" ).runCommand( {replacepeer:1} ).ok );
stopMongod( ports[ 3 ], signal );
- sleep( 2000 );
l = startMongod( "--port", ports[ 2 ], "--dbpath", "/data/db/" + baseName + "-left", "--pairwith", "127.0.0.1:" + ports[ 3 ], "127.0.0.1:" + ports[ 0 ], "--oplogSize", "1" );
r = startMongoProgram( "mongod", "--port", ports[ 3 ], "--dbpath", "/data/db/" + baseName + "-right", "--pairwith", "127.0.0.1:" + ports[ 2 ], "127.0.0.1:" + ports[ 0 ], "--oplogSize", "1" );
@@ -83,7 +81,9 @@ doTest = function( signal ) {
checkWrite( r, l );
l.setSlaveOk();
assert.eq( 3, l.getDB( baseName ).z.find().toArray().length );
-
+
+ ports.forEach( function( x ) { stopMongod( x ); } );
+
}
doTest( 15 ); // SIGTERM
diff --git a/jstests/repl/replacePeer2.js b/jstests/repl/replacePeer2.js
index 04e5209ebcf..c6d0c1e73aa 100644
--- a/jstests/repl/replacePeer2.js
+++ b/jstests/repl/replacePeer2.js
@@ -64,7 +64,6 @@ doTest = function( signal ) {
stopMongod( ports[ 3 ], signal );
stopMongod( ports[ 1 ], signal );
- sleep( 2000 );
l = startMongoProgram( "mongod", "--port", ports[ 1 ], "--dbpath", "/data/db/" + baseName + "-left", "--pairwith", "127.0.0.1:" + ports[ 2 ], "127.0.0.1:" + ports[ 0 ], "--oplogSize", "1" );
r = startMongod( "--port", ports[ 2 ], "--dbpath", "/data/db/" + baseName + "-right", "--pairwith", "127.0.0.1:" + ports[ 1 ], "127.0.0.1:" + ports[ 0 ], "--oplogSize", "1" );
@@ -84,7 +83,9 @@ doTest = function( signal ) {
checkWrite( l, r );
r.setSlaveOk();
assert.eq( 2, r.getDB( baseName ).z.find().toArray().length );
-
+
+ ports.forEach( function( x ) { stopMongod( x ); } );
+
}
doTest( 15 ); // SIGTERM