summaryrefslogtreecommitdiff
path: root/jstests/replsets
diff options
context:
space:
mode:
authorKamran Khan <kamran.khan@mongodb.com>2015-03-31 16:49:26 -0400
committerRamon Fernandez <ramon.fernandez@mongodb.com>2015-03-31 17:02:38 -0400
commit0ffc0e9294f673d6d86bfcf531d57efa9b2d6966 (patch)
tree0692d695a8562215a12450bc6ba330fbfd1a278b /jstests/replsets
parent416bcea8537bf14d4f7836b09aeef3abb36fe4f7 (diff)
downloadmongo-0ffc0e9294f673d6d86bfcf531d57efa9b2d6966.tar.gz
SERVER-17826 Ignore ismaster errors in initial_sync_unsupported_auth_schema.js
reInitiate can throw because it causes an ismaster command to be run on each secondary. These exceptions can cause intermittent test failures if the newly added secondary aborts before the ismaster command is run on it. Closes #945. Signed-off-by: Ramon Fernandez <ramon.fernandez@mongodb.com>
Diffstat (limited to 'jstests/replsets')
-rw-r--r--jstests/replsets/initial_sync_unsupported_auth_schema.js22
1 files changed, 20 insertions, 2 deletions
diff --git a/jstests/replsets/initial_sync_unsupported_auth_schema.js b/jstests/replsets/initial_sync_unsupported_auth_schema.js
index ee787f334c6..bbda9f95fa2 100644
--- a/jstests/replsets/initial_sync_unsupported_auth_schema.js
+++ b/jstests/replsets/initial_sync_unsupported_auth_schema.js
@@ -20,7 +20,16 @@ function testInitialSyncAbortsWithUnsupportedAuthSchema(schema) {
rst.add();
clearRawMongoProgramOutput();
- rst.reInitiate();
+ try {
+ rst.reInitiate();
+ }
+ catch (e) {
+ // reInitiate can throw because it tries to run an ismaster command on
+ // all secondaries, including the new one that may have already aborted
+ if (tojson(e).indexOf('error doing query: failed') === -1) {
+ throw e;
+ }
+ }
var msg;
if (schema.hasOwnProperty('currentVersion')) {
@@ -57,7 +66,16 @@ function testInitialSyncAbortsWithExistingUserAndNoAuthSchema() {
rst.add();
clearRawMongoProgramOutput();
- rst.reInitiate();
+ try {
+ rst.reInitiate();
+ }
+ catch (e) {
+ // reInitiate can throw because it tries to run an ismaster command on
+ // all secondaries, including the new one that may have already aborted
+ if (tojson(e).indexOf('error doing query: failed') === -1) {
+ throw e;
+ }
+ }
var msg = /During initial sync, found documents in admin\.system\.users/;
var assertFn = function() {