summaryrefslogtreecommitdiff
path: root/jstests/sharding/current_op_with_drop_shard.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/sharding/current_op_with_drop_shard.js')
-rw-r--r--jstests/sharding/current_op_with_drop_shard.js30
1 files changed, 15 insertions, 15 deletions
diff --git a/jstests/sharding/current_op_with_drop_shard.js b/jstests/sharding/current_op_with_drop_shard.js
index aaadca2dc3f..c6f9e7cad90 100644
--- a/jstests/sharding/current_op_with_drop_shard.js
+++ b/jstests/sharding/current_op_with_drop_shard.js
@@ -1,25 +1,25 @@
// Tests that currentOp is resilient to drop shard.
(function() {
- 'use strict';
+'use strict';
- const st = new ShardingTest({shards: 2, rs: {nodes: 1}});
+const st = new ShardingTest({shards: 2, rs: {nodes: 1}});
- // We need the balancer to remove a shard.
- st.startBalancer();
+// We need the balancer to remove a shard.
+st.startBalancer();
- const mongosDB = st.s.getDB(jsTestName());
- const shardName = st.shard0.shardName;
+const mongosDB = st.s.getDB(jsTestName());
+const shardName = st.shard0.shardName;
- var res = st.s.adminCommand({removeShard: shardName});
+var res = st.s.adminCommand({removeShard: shardName});
+assert.commandWorked(res);
+assert.eq('started', res.state);
+assert.soon(function() {
+ res = st.s.adminCommand({removeShard: shardName});
assert.commandWorked(res);
- assert.eq('started', res.state);
- assert.soon(function() {
- res = st.s.adminCommand({removeShard: shardName});
- assert.commandWorked(res);
- return ('completed' === res.state);
- }, "removeShard never completed for shard " + shardName);
+ return ('completed' === res.state);
+}, "removeShard never completed for shard " + shardName);
- assert.commandWorked(mongosDB.currentOp());
+assert.commandWorked(mongosDB.currentOp());
- st.stop();
+st.stop();
})();