diff options
author | Benety Goh <benety@mongodb.com> | 2022-10-31 20:15:13 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-10-31 21:35:57 +0000 |
commit | cb7c3dc2355b6f907c640415fb8c31181e27f246 (patch) | |
tree | 81fede923f18297b01f5e3fe226dbdef0fffd467 /jstests | |
parent | 8eccc479d9f5427fa369e1c1b473303411bdb78f (diff) | |
download | mongo-cb7c3dc2355b6f907c640415fb8c31181e27f246.tar.gz |
SERVER-70976 assign unique collection names to each test case in arrayfind8.js
Diffstat (limited to 'jstests')
-rw-r--r-- | jstests/core/arrayfind8.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/jstests/core/arrayfind8.js b/jstests/core/arrayfind8.js index 87a3a8d701a..087410efab2 100644 --- a/jstests/core/arrayfind8.js +++ b/jstests/core/arrayfind8.js @@ -5,8 +5,9 @@ (function() { "use strict"; -const coll = db.jstests_arrayfind8; -coll.drop(); +const collNamePrefix = 'jstests_arrayfind8_'; +let collCount = 0; +let coll; // May be changed during the test. let currentIndexSpec = {a: 1}; @@ -55,6 +56,8 @@ function checkMatch(bothMatch, elemMatch, nonElemMatch, standardQuery, elemMatch * @param additionalConstraints - additional query parameters not generated from @param subQuery */ function checkQuery(subQuery, bothMatch, elemMatch, nonElemMatch, additionalConstraints) { + const collNameSuffix = collCount++; + coll = db.getCollection(collNamePrefix + 'noindex_' + collNameSuffix); coll.drop(); additionalConstraints = additionalConstraints || {}; @@ -86,7 +89,8 @@ function checkQuery(subQuery, bothMatch, elemMatch, nonElemMatch, additionalCons // Check matching and index bounds for a single key index. - assert.eq(coll.drop(), true); + coll = db.getCollection(collNamePrefix + 'index_' + collNameSuffix); + coll.drop(); insertValueIfNotNull(bothMatch); insertValueIfNotNull(elemMatch); // The nonElemMatch document is not tested here, as it will often make the index multikey. |