summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaddie Zechar <mez2113@columbia.edu>2022-03-02 20:40:12 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-03-08 16:16:32 +0000
commitcf6ac4d17da6eb6562f503a515ea6aea2ccbf944 (patch)
tree3719ce54b279ad6e1e4a1488faf819a483c3400e
parentebb15b33a2524d5999de8b71f252ee34714fbc46 (diff)
downloadmongo-cf6ac4d17da6eb6562f503a515ea6aea2ccbf944.tar.gz
SERVER-64092: Fix pipeline_length_limit_tests.js for mixed debugged variantsr5.3.0-rc3
(cherry picked from commit 642b5726218b867c48aad2a05dca069fec259bbd)
-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}},