summaryrefslogtreecommitdiff
path: root/jstests/sharding/query/current_op_with_drop_shard.js
blob: f92945fe32a7b7b3eac1c3e2701388c522939ba0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Tests that currentOp is resilient to drop shard.
(function() {
'use strict';
load('jstests/sharding/libs/remove_shard_util.js');

// TODO SERVER-50144 Remove this and allow orphan checking.
// This test calls removeShard which can leave docs in config.rangeDeletions in state "pending",
// therefore preventing orphans from being cleaned up.
TestData.skipCheckOrphans = true;

const st = new ShardingTest({shards: 2, rs: {nodes: 1}});

// We need the balancer to remove a shard.
st.startBalancer();

const mongosDB = st.s.getDB(jsTestName());
const shardName = st.shard0.shardName;

removeShard(st, shardName);

assert.commandWorked(mongosDB.currentOp());

st.stop();
})();