diff options
author | Matthew Saltz <matthew.saltz@mongodb.com> | 2018-05-22 11:26:38 -0400 |
---|---|---|
committer | Matthew Saltz <matthew.saltz@mongodb.com> | 2018-05-23 14:10:55 -0400 |
commit | 85bedb96ec711af3d583c7204b032d266de2c54b (patch) | |
tree | 462fe7aaf5025d7fd2cc374f17e7ded44cc4697b | |
parent | 052a432c6bc6289e0be7f9980bcf1bb687ae1d96 (diff) | |
download | mongo-85bedb96ec711af3d583c7204b032d266de2c54b.tar.gz |
SERVER-34835 Fix shard_does_not_hang_on_bad_config_server.js
-rw-r--r-- | jstests/noPassthrough/shard_does_not_hang_on_bad_config_server.js | 79 |
1 files changed, 40 insertions, 39 deletions
diff --git a/jstests/noPassthrough/shard_does_not_hang_on_bad_config_server.js b/jstests/noPassthrough/shard_does_not_hang_on_bad_config_server.js index 184e0ed00d9..c7260e44948 100644 --- a/jstests/noPassthrough/shard_does_not_hang_on_bad_config_server.js +++ b/jstests/noPassthrough/shard_does_not_hang_on_bad_config_server.js @@ -1,39 +1,40 @@ -(function() {
- 'use strict';
-
- var conn = MongoRunner.runMongod();
-
- var res;
-
- var connA = new Mongo(conn.host);
- res = assert.commandFailed(connA.adminCommand({
- moveChunk: 'DummyDB.DummyColl',
- configdb: 'localhost:1',
- fromShard: 'DummyFromShard',
- toShard: 'DummyToShard',
- min: {Key: -1},
- max: {Key: 1},
- maxChunkSizeBytes: 1024,
- maxTimeMS: 10000
- }));
- assert.eq(ErrorCodes.ExceededTimeLimit, res.code);
-
- // Sharding state is now initialized at this point, although with an unreachable config.
-
- var connB = new Mongo(conn.host);
- res = assert.commandFailed(connB.adminCommand({
- moveChunk: 'DummyDB.DummyColl',
- configdb: 'localhost:1',
- fromShard: 'DummyFromShard',
- toShard: 'DummyToShard',
- min: {Key: -1},
- max: {Key: 1},
- maxChunkSizeBytes: 1024,
- maxTimeMS: 10000
- }));
- // Cannot reach config server.
- assert.eq(ErrorCodes.HostUnreachable, res.code);
-
- MongoRunner.stopMongod(conn);
-
-})();
+(function() { + 'use strict'; + + var conn = MongoRunner.runMongod(); + + var res; + + var connA = new Mongo(conn.host); + res = assert.commandFailed(connA.adminCommand({ + moveChunk: 'DummyDB.DummyColl', + configdb: 'localhost:1', + fromShard: 'DummyFromShard', + toShard: 'DummyToShard', + min: {Key: -1}, + max: {Key: 1}, + maxChunkSizeBytes: 1024, + maxTimeMS: 10000 + })); + assert.eq(ErrorCodes.ExceededTimeLimit, res.code); + + // Sharding state is now initialized at this point, although with an unreachable config. + + var connB = new Mongo(conn.host); + res = assert.commandFailed(connB.adminCommand({ + moveChunk: 'DummyDB.DummyColl', + configdb: 'localhost:1', + fromShard: 'DummyFromShard', + toShard: 'DummyToShard', + min: {Key: -1}, + max: {Key: 1}, + maxChunkSizeBytes: 1024, + maxTimeMS: 10000 + })); + + // Cannot reach config server. + assert(res.code == ErrorCodes.HostUnreachable || res.code == ErrorCodes.ExceededTimeLimit, + 'Result was: ' + tojson(res)); + MongoRunner.stopMongod(conn); + +})(); |