diff options
author | Scott Hernandez <scotthernandez@gmail.com> | 2015-10-24 09:09:49 -0400 |
---|---|---|
committer | Scott Hernandez <scotthernandez@gmail.com> | 2015-10-26 12:46:55 -0400 |
commit | f441ea186ea394a06077deb71200bb197cf0052d (patch) | |
tree | 5fc54f574774107f2e397e735423271dacee51d6 | |
parent | 6c5fb5a67d83d2d35214b8beb276b20f55ab2510 (diff) | |
download | mongo-f441ea186ea394a06077deb71200bb197cf0052d.tar.gz |
add validation for waitForState on states to fix initial_sync_cloner_dups.js
-rw-r--r-- | jstests/noPassthrough/initial_sync_cloner_dups.js | 2 | ||||
-rw-r--r-- | src/mongo/shell/replsettest.js | 9 |
2 files changed, 8 insertions, 3 deletions
diff --git a/jstests/noPassthrough/initial_sync_cloner_dups.js b/jstests/noPassthrough/initial_sync_cloner_dups.js index 93433b3f439..0b4ec1368bc 100644 --- a/jstests/noPassthrough/initial_sync_cloner_dups.js +++ b/jstests/noPassthrough/initial_sync_cloner_dups.js @@ -78,7 +78,7 @@ replTest.reInitiate(awaitTimeout * 2); secondary.setSlaveOk(); // Wait for the secondary to get ReplSetInitiate command. replTest.waitForState(secondary, - [replTest.STARTUP2, replTest.RECOVERING, replTest.SECONDARY], + [replTest.STARTUP_2, replTest.RECOVERING, replTest.SECONDARY], 60 * 1000); // This fail point will cause the first intial sync to fail, and leave an op in the buffer to diff --git a/src/mongo/shell/replsettest.js b/src/mongo/shell/replsettest.js index 33cf7f87895..88fae5c84e9 100644 --- a/src/mongo/shell/replsettest.js +++ b/src/mongo/shell/replsettest.js @@ -1127,8 +1127,13 @@ ReplSetTest.prototype.waitForIndicator = function( node, states, ind, timeout ){ if( status.members[i].name == node.host || status.members[i].name == node.name ) { for( var j = 0; j < states.length; j++ ) { if( printStatus ) { - print( "Status " + " : " + status.members[i][ind] + - " target state : " + states[j] ); + print( "Status -- " + " current state: " + status.members[i][ind] + + ", target state : " + states[j] ); + } + + if (typeof(states[j]) != "number") { + throw new Error("State was not an number -- type:" + + typeof(states[j]) + ", value:" + states[j]); } if( status.members[i][ind] == states[j] ) { return true; |