-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
Fully Compatible
-
ALL
-
Sharding EMEA 2022-11-14
-
35
Inside the jstest remove_shard_util.js (line 7) we are asserting that a command will work (removing a shard) and then handle the output error situation of that call. So, when the removeShard fails, we will get a failure on the test.
let res = assert.commandWorked(st.s.adminCommand({removeShard: shardName})); if (!res.ok && res.code === ErrorCodes.ShardNotFound) { // ... return true; }
We should get the result on the variable first and then handle the error before asserting that the command worked.