summaryrefslogtreecommitdiff
path: root/jstests/cqf
diff options
context:
space:
mode:
authorSvilen Mihaylov <svilen.mihaylov@mongodb.com>2022-06-09 12:45:52 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-06-09 13:48:57 +0000
commitafe91bb1ffbca4339acc2cddb5818115c8c9ef95 (patch)
treefd8a0504b7933e69ef597f936bd4512f0c014ba6 /jstests/cqf
parentabfa534efdee117fddbd91bb284f2e7b0f327c12 (diff)
downloadmongo-afe91bb1ffbca4339acc2cddb5818115c8c9ef95.tar.gz
SERVER-67120 Make CE more robust for array_match.js
Diffstat (limited to 'jstests/cqf')
-rw-r--r--jstests/cqf/array_match.js14
1 files changed, 8 insertions, 6 deletions
diff --git a/jstests/cqf/array_match.js b/jstests/cqf/array_match.js
index 11abaf2a990..01120310947 100644
--- a/jstests/cqf/array_match.js
+++ b/jstests/cqf/array_match.js
@@ -10,15 +10,17 @@ if (!checkCascadesOptimizerEnabled(db)) {
const t = db.cqf_array_match;
t.drop();
-assert.commandWorked(t.insert({a: 2, b: 1}));
-assert.commandWorked(t.insert({a: [2], b: 1}));
-assert.commandWorked(t.insert({a: [[2]], b: 1}));
+for (let i = 0; i < 10; i++) {
+ assert.commandWorked(t.insert({a: 2, b: 1}));
+ assert.commandWorked(t.insert({a: [2], b: 1}));
+ assert.commandWorked(t.insert({a: [[2]], b: 1}));
+}
assert.commandWorked(t.createIndex({a: 1}));
{
const res = t.explain("executionStats").aggregate([{$match: {a: {$eq: [2]}}}]);
- assert.eq(2, res.executionStats.nReturned);
+ assert.eq(20, res.executionStats.nReturned);
assert.eq("PhysicalScan", res.queryPlanner.winningPlan.optimizerPlan.child.child.nodeType);
}
@@ -31,7 +33,7 @@ assert.commandWorked(bulk.execute());
{
const res = t.explain("executionStats").aggregate([{$match: {a: {$eq: [2]}}}]);
- assert.eq(2, res.executionStats.nReturned);
+ assert.eq(20, res.executionStats.nReturned);
const indexUnionNode = res.queryPlanner.winningPlan.optimizerPlan.child.child.leftChild.child;
assert.eq("Union", indexUnionNode.nodeType);
@@ -46,7 +48,7 @@ assert.commandWorked(t.createIndex({b: 1, a: 1}));
{
const res = t.explain("executionStats").aggregate([{$match: {b: 1, a: {$eq: [2]}}}]);
- assert.eq(2, res.executionStats.nReturned);
+ assert.eq(20, res.executionStats.nReturned);
// Verify we still get index scan even if the field appears as second index field.
const indexUnionNode = res.queryPlanner.winningPlan.optimizerPlan.child.child.leftChild.child;