summaryrefslogtreecommitdiff
path: root/jstests/sharding/analyze_shard_key/monotonicity_range_sharding_compound.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/sharding/analyze_shard_key/monotonicity_range_sharding_compound.js')
-rw-r--r--jstests/sharding/analyze_shard_key/monotonicity_range_sharding_compound.js13
1 files changed, 10 insertions, 3 deletions
diff --git a/jstests/sharding/analyze_shard_key/monotonicity_range_sharding_compound.js b/jstests/sharding/analyze_shard_key/monotonicity_range_sharding_compound.js
index f16166da462..8d903f49e97 100644
--- a/jstests/sharding/analyze_shard_key/monotonicity_range_sharding_compound.js
+++ b/jstests/sharding/analyze_shard_key/monotonicity_range_sharding_compound.js
@@ -60,11 +60,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: 2500,
+ max: 5000
+};
+
{
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();
}
@@ -75,7 +82,7 @@ for (let orderType0 of kOrderTypes) {
rst.initiate();
const primary = rst.getPrimary();
- testAnalyzeShardKeysUnshardedCollection(primary, testCases);
+ testAnalyzeShardKeysUnshardedCollection(primary, testCases, numDocsRange);
rst.stopSet();
}