summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--jstests/sharding/query/pipeline_length_limit.js24
1 files changed, 14 insertions, 10 deletions
diff --git a/jstests/sharding/query/pipeline_length_limit.js b/jstests/sharding/query/pipeline_length_limit.js
index 5f5df3d7d85..aad69742163 100644
--- a/jstests/sharding/query/pipeline_length_limit.js
+++ b/jstests/sharding/query/pipeline_length_limit.js
@@ -164,19 +164,23 @@ function runTest(lengthLimit, mongosConfig = {}, mongodConfig = {}) {
st.stop();
}
+// This is a sanity check to make sure that the default value is correct. If the limit is changed,
+// it will break for users and this check catches that.
const st = new ShardingTest({shards: 1, rs: {nodes: 1}});
-const debugBuild = st.s0.getDB("TestDB").adminCommand("buildInfo").debug;
+let buildInfo = assert.commandWorked(st.s0.getDB("test").adminCommand("buildInfo"));
+let pipelineLimit =
+ assert.commandWorked(st.s0.adminCommand({"getParameter": 1, "internalPipelineLengthLimit": 1}));
+let expectedPipelineLimit = buildInfo.debug ? 200 : 1000;
+assert.eq(expectedPipelineLimit, pipelineLimit["internalPipelineLengthLimit"]);
+
+const shardPrimary = st.rs0.getPrimary().getDB("test");
+buildInfo = assert.commandWorked(shardPrimary.adminCommand("buildInfo"));
+expectedPipelineLimit = buildInfo.debug ? 200 : 1000;
+pipelineLimit = assert.commandWorked(
+ shardPrimary.adminCommand({"getParameter": 1, "internalPipelineLengthLimit": 1}));
+assert.eq(expectedPipelineLimit, pipelineLimit["internalPipelineLengthLimit"]);
st.stop();
-if (!debugBuild) {
- // Test default pipeline length limit.
- runTest(1000);
-} else {
- // In debug builds we need to run with a lower limit because the available stack space is half
- // what is available in normal builds.
- runTest(200);
-}
-
// Test with modified pipeline length limit.
runTest(50,
{setParameter: {internalPipelineLengthLimit: 50}},