summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPol Pinol Castuera <pol.pinol@mongodb.com>2022-11-02 12:41:05 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-11-02 13:36:22 +0000
commit1c454cfbc7e9f289e38dccdb625dbb859a2b1b39 (patch)
tree4c4bf405cb4f49c8436952fce9047b55e5f0c2c0
parenta49375640eec2e8016dfb9a00c8a9d0dd6d00d26 (diff)
downloadmongo-1c454cfbc7e9f289e38dccdb625dbb859a2b1b39.tar.gz
SERVER-70925 Changed the logic inside 'removeShard' helper.
-rw-r--r--jstests/sharding/libs/remove_shard_util.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/jstests/sharding/libs/remove_shard_util.js b/jstests/sharding/libs/remove_shard_util.js
index 6fb1a7ca8b2..11338f68f53 100644
--- a/jstests/sharding/libs/remove_shard_util.js
+++ b/jstests/sharding/libs/remove_shard_util.js
@@ -4,7 +4,7 @@ function removeShard(st, shardName, timeout) {
}
assert.soon(function() {
- let res = assert.commandWorked(st.s.adminCommand({removeShard: shardName}));
+ const res = st.s.adminCommand({removeShard: shardName});
if (!res.ok && res.code === ErrorCodes.ShardNotFound) {
// If the config server primary steps down right after removing the config.shards doc
// for the shard but before responding with "state": "completed", the mongos would retry
@@ -14,6 +14,7 @@ function removeShard(st, shardName, timeout) {
// to fail with ShardNotFound.
return true;
}
+ assert.commandWorked(res);
return res.state == 'completed';
}, "failed to remove shard " + shardName + " within " + timeout + "ms", timeout);
}