diff options
author | Benety Goh <benety@mongodb.com> | 2016-11-07 14:28:24 -0500 |
---|---|---|
committer | Benety Goh <benety@mongodb.com> | 2016-11-07 15:54:09 -0500 |
commit | d4a7ae574011cf40e7785c439969904954e18db2 (patch) | |
tree | 1906f4d588ea4a841ebf123fa85e7e9928cb9af6 /jstests/replsets | |
parent | 9a0127c107c8b3f1e80453075848c4372a25e075 (diff) | |
download | mongo-d4a7ae574011cf40e7785c439969904954e18db2.tar.gz |
SERVER-26934 removed hardcoded ReplSetTest.awaitReplication timeouts from JS tests
Diffstat (limited to 'jstests/replsets')
-rw-r--r-- | jstests/replsets/catchup.js | 8 | ||||
-rw-r--r-- | jstests/replsets/initial_sync1.js | 2 | ||||
-rw-r--r-- | jstests/replsets/initial_sync2.js | 2 | ||||
-rw-r--r-- | jstests/replsets/linearizable_read_concern.js | 8 | ||||
-rw-r--r-- | jstests/replsets/replset5.js | 2 | ||||
-rw-r--r-- | jstests/replsets/replset9.js | 2 | ||||
-rw-r--r-- | jstests/replsets/sync_passive.js | 2 |
7 files changed, 13 insertions, 13 deletions
diff --git a/jstests/replsets/catchup.js b/jstests/replsets/catchup.js index 8bf0bc08ead..407735bd604 100644 --- a/jstests/replsets/catchup.js +++ b/jstests/replsets/catchup.js @@ -96,14 +96,14 @@ load("jstests/replsets/rslib.js"); jsTest.log("Case 1: The primary is up-to-date after freshness scan."); // Should complete transition to primary immediately. - rst.awaitReplication(30000, ReplSetTest.OpTimeType.LAST_DURABLE); + rst.awaitReplication(ReplSetTest.kDefaultTimeoutMS, ReplSetTest.OpTimeType.LAST_DURABLE); var newPrimary = stepUp(rst.getSecondary()); rst.awaitNodesAgreeOnPrimary(); // Should win an election and finish the transition very quickly. assert.eq(newPrimary, rst.getPrimary()); jsTest.log("Case 2: The primary needs to catch up, succeeds in time."); - rst.awaitReplication(30000, ReplSetTest.OpTimeType.LAST_DURABLE); + rst.awaitReplication(ReplSetTest.kDefaultTimeoutMS, ReplSetTest.OpTimeType.LAST_DURABLE); // Write documents that cannot be replicated to secondaries in time. var originalSecondaries = rst.getSecondaries(); originalSecondaries.forEach(enableFailPoint); @@ -124,7 +124,7 @@ load("jstests/replsets/rslib.js"); checkOpInOplog(newPrimary, latestOp, 1); jsTest.log("Case 3: The primary needs to catch up, fails due to timeout."); - rst.awaitReplication(30000, ReplSetTest.OpTimeType.LAST_DURABLE); + rst.awaitReplication(ReplSetTest.kDefaultTimeoutMS, ReplSetTest.OpTimeType.LAST_DURABLE); // Write documents that cannot be replicated to secondaries in time. originalSecondaries = rst.getSecondaries(); originalSecondaries.forEach(enableFailPoint); @@ -152,7 +152,7 @@ load("jstests/replsets/rslib.js"); disableFailPoint(originalSecondaries[1]); jsTest.log("Case 4: The primary needs to catch up, but has to change sync source to catch up."); - rst.awaitReplication(30000, ReplSetTest.OpTimeType.LAST_DURABLE); + rst.awaitReplication(ReplSetTest.kDefaultTimeoutMS, ReplSetTest.OpTimeType.LAST_DURABLE); // Write documents that cannot be replicated to secondaries in time. rst.getSecondaries().forEach(enableFailPoint); doWrites(rst.getPrimary()); diff --git a/jstests/replsets/initial_sync1.js b/jstests/replsets/initial_sync1.js index 51d355d80c1..3087793dcd1 100644 --- a/jstests/replsets/initial_sync1.js +++ b/jstests/replsets/initial_sync1.js @@ -100,7 +100,7 @@ for (var i = 0; i < 100; i++) { assert.writeOK(bulk.execute()); print("11. Everyone happy eventually"); -replTest.awaitReplication(300000); +replTest.awaitReplication(); MongoRunner.stopMongod(slave2); replTest.stopSet(); diff --git a/jstests/replsets/initial_sync2.js b/jstests/replsets/initial_sync2.js index 69c91d30f04..b70dd71bb8f 100644 --- a/jstests/replsets/initial_sync2.js +++ b/jstests/replsets/initial_sync2.js @@ -96,7 +96,7 @@ var doTest = function() { replTest.waitForState(replTest.nodes[0], ReplSetTest.State.PRIMARY); jsTest.log("12. Everyone happy eventually"); - replTest.awaitReplication(2 * 60 * 1000); + replTest.awaitReplication(); replTest.stopSet(); }; diff --git a/jstests/replsets/linearizable_read_concern.js b/jstests/replsets/linearizable_read_concern.js index 4cbef17b568..58fe4de0bcc 100644 --- a/jstests/replsets/linearizable_read_concern.js +++ b/jstests/replsets/linearizable_read_concern.js @@ -43,10 +43,10 @@ load('jstests/libs/write_concern_util.js'); replTest.startSet(); replTest.initiate(config); - // We increase the awaitReplication timeout because without a sync source the heartbeat - // interval will be half of the election timeout, 30 seconds. It thus will take almost - // 30 seconds for the secondaries to set the primary as their sync source and begin replicating. - replTest.awaitReplication(90 * 1000); + // Without a sync source the heartbeat interval will be half of the election timeout, 30 + // seconds. It thus will take almost 30 seconds for the secondaries to set the primary as + // their sync source and begin replicating. + replTest.awaitReplication(); var primary = replTest.getPrimary(); var secondaries = replTest.getSecondaries(); diff --git a/jstests/replsets/replset5.js b/jstests/replsets/replset5.js index e0b4ed85994..25c073571f1 100644 --- a/jstests/replsets/replset5.js +++ b/jstests/replsets/replset5.js @@ -25,7 +25,7 @@ load("jstests/replsets/rslib.js"); // Initial replication master.getDB("barDB").bar.save({a: 1}); - replTest.awaitReplication(5 * 60 * 1000); + replTest.awaitReplication(); // These writes should be replicated immediately var docNum = 5000; diff --git a/jstests/replsets/replset9.js b/jstests/replsets/replset9.js index c1493908f12..960f24f46be 100644 --- a/jstests/replsets/replset9.js +++ b/jstests/replsets/replset9.js @@ -69,4 +69,4 @@ assert.writeOK(bulk.execute()); print("finished"); // Wait for replication to catch up. -rt.awaitReplication(640000); +rt.awaitReplication(); diff --git a/jstests/replsets/sync_passive.js b/jstests/replsets/sync_passive.js index c0be375b98b..321a198e9af 100644 --- a/jstests/replsets/sync_passive.js +++ b/jstests/replsets/sync_passive.js @@ -57,7 +57,7 @@ print("restart #1"); replTest.restart(1); print("check sync"); -replTest.awaitReplication(60 * 1000); +replTest.awaitReplication(); print("add data"); reconnect(server1); |