diff options
author | Kim Tao <kimberly.tao@10gen.com> | 2018-12-04 16:15:25 -0500 |
---|---|---|
committer | Blake Oler <blake.oler@mongodb.com> | 2019-04-09 16:47:30 -0400 |
commit | 789a26ba61c4559ca7f28b60f85c04745a4d2440 (patch) | |
tree | babe3f50f55dfeb50025b6f37dde7a42ddb7819c | |
parent | 2aa3ce1574522ad4a5b56c440ae9dc92af4395ae (diff) | |
download | mongo-789a26ba61c4559ca7f28b60f85c04745a4d2440.tar.gz |
SERVER-36457: mongos_rs_shard_failure_tolerance.js shold assert that movePrimary command succeeds
(cherry picked from commit 00520c2e0b89483e390ecb25cd3291ca8fa30c0f)
-rw-r--r-- | jstests/sharding/mongos_rs_auth_shard_failure_tolerance.js | 5 | ||||
-rw-r--r-- | jstests/sharding/mongos_rs_shard_failure_tolerance.js | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/jstests/sharding/mongos_rs_auth_shard_failure_tolerance.js b/jstests/sharding/mongos_rs_auth_shard_failure_tolerance.js index 5ce56f9f546..25f18ef1f92 100644 --- a/jstests/sharding/mongos_rs_auth_shard_failure_tolerance.js +++ b/jstests/sharding/mongos_rs_auth_shard_failure_tolerance.js @@ -54,12 +54,13 @@ var collUnsharded = mongos.getCollection("fooUnsharded.barUnsharded"); // Create the unsharded database with shard0 primary assert.writeOK(collUnsharded.insert({some: "doc"})); assert.writeOK(collUnsharded.remove({})); -printjson( +assert.commandWorked( admin.runCommand({movePrimary: collUnsharded.getDB().toString(), to: st.shard0.shardName})); // Create the sharded database with shard1 primary assert.commandWorked(admin.runCommand({enableSharding: collSharded.getDB().toString()})); -printjson(admin.runCommand({movePrimary: collSharded.getDB().toString(), to: st.shard1.shardName})); +assert.commandWorked( + admin.runCommand({movePrimary: collSharded.getDB().toString(), to: st.shard1.shardName})); assert.commandWorked(admin.runCommand({shardCollection: collSharded.toString(), key: {_id: 1}})); assert.commandWorked(admin.runCommand({split: collSharded.toString(), middle: {_id: 0}})); assert.commandWorked(admin.runCommand( diff --git a/jstests/sharding/mongos_rs_shard_failure_tolerance.js b/jstests/sharding/mongos_rs_shard_failure_tolerance.js index ac117877cb5..7b43adcdd49 100644 --- a/jstests/sharding/mongos_rs_shard_failure_tolerance.js +++ b/jstests/sharding/mongos_rs_shard_failure_tolerance.js @@ -31,12 +31,12 @@ TestData.skipCheckingUUIDsConsistentAcrossCluster = true; // Create the unsharded database assert.writeOK(collUnsharded.insert({some: "doc"})); assert.writeOK(collUnsharded.remove({})); - printjson( + assert.commandWorked( admin.runCommand({movePrimary: collUnsharded.getDB().toString(), to: st.shard0.shardName})); // Create the sharded database assert.commandWorked(admin.runCommand({enableSharding: collSharded.getDB().toString()})); - printjson( + assert.commandWorked( admin.runCommand({movePrimary: collSharded.getDB().toString(), to: st.shard0.shardName})); assert.commandWorked( admin.runCommand({shardCollection: collSharded.toString(), key: {_id: 1}})); |