diff options
author | Cheahuychou Mao <cheahuychou.mao@mongodb.com> | 2019-11-01 15:46:39 +0000 |
---|---|---|
committer | evergreen <evergreen@mongodb.com> | 2019-11-01 15:46:39 +0000 |
commit | 97e827840a95b9c9678535da261a265d7d17d32c (patch) | |
tree | a462d60594317209928f881f8c5259eb4476a78a /jstests/sharding/refine_collection_shard_key_drops_chunks.js | |
parent | 384292b85cbf344602b377a81821d7b1924b978e (diff) | |
download | mongo-97e827840a95b9c9678535da261a265d7d17d32c.tar.gz |
SERVER-44261 Replace waitForFailpoint function with waitForFailPoint command
Diffstat (limited to 'jstests/sharding/refine_collection_shard_key_drops_chunks.js')
-rw-r--r-- | jstests/sharding/refine_collection_shard_key_drops_chunks.js | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/jstests/sharding/refine_collection_shard_key_drops_chunks.js b/jstests/sharding/refine_collection_shard_key_drops_chunks.js index db468cbf5bf..9f89445fa67 100644 --- a/jstests/sharding/refine_collection_shard_key_drops_chunks.js +++ b/jstests/sharding/refine_collection_shard_key_drops_chunks.js @@ -5,7 +5,7 @@ (function() { 'use strict'; -load('jstests/sharding/libs/sharded_transactions_helpers.js'); +load('jstests/libs/fail_point_util.js'); const st = new ShardingTest({shards: 1}); const mongos = st.s0; @@ -51,22 +51,19 @@ assert.eq({a: MaxKey, b: MaxKey}, chunkArr[2].max); // Enable failpoint 'hangPersistCollectionAndChangedChunksAfterDropChunks' and flush the routing // table cache. -assert.commandWorked(shard.adminCommand({ - configureFailPoint: 'hangPersistCollectionAndChangedChunksAfterDropChunks', - mode: 'alwaysOn' -})); +let hangAfterDropChunksFailPoint = + configureFailPoint(shard, 'hangPersistCollectionAndChangedChunksAfterDropChunks'); assert.commandWorked(mongos.adminCommand({refineCollectionShardKey: kNsName, key: newKeyDoc})); // Verify that all chunks belonging to 'db.foo' have been deleted. -waitForFailpoint('Hit hangPersistCollectionAndChangedChunksAfterDropChunks', 1); +hangAfterDropChunksFailPoint.wait(); chunkArr = shard.getCollection(kConfigCacheChunks).find({}).sort({min: 1}).toArray(); assert.eq(0, chunkArr.length); // Disable failpoint 'hangPersistCollectionAndChangedChunksAfterDropChunks' and continue // flushing the routing table cache. -assert.commandWorked(shard.adminCommand( - {configureFailPoint: 'hangPersistCollectionAndChangedChunksAfterDropChunks', mode: 'off'})); +hangAfterDropChunksFailPoint.off(); // Verify that 'config.cache.chunks.db.foo' is as expected after refineCollectionShardKey. NOTE: We // use assert.soon here because refineCollectionShardKey doesn't block for each shard to refresh. |