From afe91bb1ffbca4339acc2cddb5818115c8c9ef95 Mon Sep 17 00:00:00 2001 From: Svilen Mihaylov Date: Thu, 9 Jun 2022 12:45:52 +0000 Subject: SERVER-67120 Make CE more robust for array_match.js --- jstests/cqf/array_match.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'jstests/cqf') 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; -- cgit v1.2.1