diff options
author | Ruoxin Xu <ruoxin.xu@mongodb.com> | 2023-05-05 17:55:30 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2023-05-05 18:45:33 +0000 |
commit | cfdd5d9b4017876ba387b950d0467121343f59b7 (patch) | |
tree | 64733c7c85c17eeef08dde9f086fd3c88d430f0c /jstests/core | |
parent | 22707c4f3a2c26529d5487e4d036aa3cbcb3ff2e (diff) | |
download | mongo-cfdd5d9b4017876ba387b950d0467121343f59b7.tar.gz |
SERVER-76780 Robustify sparse_index_internal_expr.js and compound_wildcard_index_hiding.js test
Diffstat (limited to 'jstests/core')
-rw-r--r-- | jstests/core/index/sparse_index_internal_expr.js | 10 | ||||
-rw-r--r-- | jstests/core/index/wildcard/compound_wildcard_index_hiding.js | 1 |
2 files changed, 7 insertions, 4 deletions
diff --git a/jstests/core/index/sparse_index_internal_expr.js b/jstests/core/index/sparse_index_internal_expr.js index 9ac47a5c100..485c2a0b133 100644 --- a/jstests/core/index/sparse_index_internal_expr.js +++ b/jstests/core/index/sparse_index_internal_expr.js @@ -5,6 +5,7 @@ * * @tags: [ * multiversion_incompatible, + * does_not_support_transaction, * ] */ @@ -47,7 +48,8 @@ assert.docEq(res[0], {a: 1}); // Drop the non-sparse index and create a sparse index with the same key pattern. assert.commandWorked(coll.dropIndex("missing_1")); -assert.commandWorked(coll.createIndex({'missing': 1}, {'sparse': true})); +assert.commandWorked( + coll.createIndex({'missing': 1}, {'sparse': true, 'name': 'missing_1_sparse'})); // Run the same query to test that a COLLSCAN plan is used rather than an indexed plan. const collScans = @@ -58,13 +60,13 @@ assert.gt(collScans.length, 0, collScans); // Test that a sparse index can be hinted to answer $expr query but incomplete results in returned, // because the document is not indexed by the sparse index. -res = coll.find(exprQuery, {_id: 0}).hint("missing_1").toArray(); +res = coll.find(exprQuery, {_id: 0}).hint("missing_1_sparse").toArray(); assert.eq(res.length, 0); ixScans = getPlanStages( - getWinningPlan(coll.find(exprQuery).hint("missing_1").explain().queryPlanner), "IXSCAN"); + getWinningPlan(coll.find(exprQuery).hint("missing_1_sparse").explain().queryPlanner), "IXSCAN"); assert.gt(ixScans.length, 0, ixScans); -assert.eq("missing_1", ixScans[0].indexName, ixScans); +assert.eq("missing_1_sparse", ixScans[0].indexName, ixScans); assert.eq(true, ixScans[0].isSparse, ixScans); }()); diff --git a/jstests/core/index/wildcard/compound_wildcard_index_hiding.js b/jstests/core/index/wildcard/compound_wildcard_index_hiding.js index 968baeff123..a3e304bfc4b 100644 --- a/jstests/core/index/wildcard/compound_wildcard_index_hiding.js +++ b/jstests/core/index/wildcard/compound_wildcard_index_hiding.js @@ -5,6 +5,7 @@ * @tags: [ * not_allowed_with_security_token, * does_not_support_stepdowns, + * does_not_support_transaction, * featureFlagCompoundWildcardIndexes, * requires_fcv_70, * ] |