diff options
Diffstat (limited to 'jstests/sharding/analyze_shard_key/monotonicity_range_sharding_non_compound.js')
-rw-r--r-- | jstests/sharding/analyze_shard_key/monotonicity_range_sharding_non_compound.js | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/jstests/sharding/analyze_shard_key/monotonicity_range_sharding_non_compound.js b/jstests/sharding/analyze_shard_key/monotonicity_range_sharding_non_compound.js index 526f920a68b..dbfa1c992d3 100644 --- a/jstests/sharding/analyze_shard_key/monotonicity_range_sharding_non_compound.js +++ b/jstests/sharding/analyze_shard_key/monotonicity_range_sharding_non_compound.js @@ -48,11 +48,18 @@ for (let orderType0 of kOrderTypes) { } } +// This test requires the collection to contain at least a few thousands of documents to smooth out +// the noise in the insertion order caused by the oplog application batching on secondaries. +const numDocsRange = { + min: 5000, + max: 10000 +}; + { const st = new ShardingTest({shards: 2, rs: {nodes: 2}}); - testAnalyzeShardKeysUnshardedCollection(st.s, testCases); - testAnalyzeShardKeysShardedCollection(st, testCases); + testAnalyzeShardKeysUnshardedCollection(st.s, testCases, numDocsRange); + testAnalyzeShardKeysShardedCollection(st, testCases, numDocsRange); st.stop(); } @@ -63,7 +70,7 @@ for (let orderType0 of kOrderTypes) { rst.initiate(); const primary = rst.getPrimary(); - testAnalyzeShardKeysUnshardedCollection(primary, testCases); + testAnalyzeShardKeysUnshardedCollection(primary, testCases, numDocsRange); rst.stopSet(); } |