diff options
author | Benety Goh <benety@mongodb.com> | 2021-04-06 19:47:27 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-04-07 00:11:18 +0000 |
commit | 9b2bf60ff8a768e609920cadc081a347e2f0eaa7 (patch) | |
tree | 74532c080c8c952ed07a3fba50047a244cdf6cde /jstests | |
parent | fc8eaf32ef28738e9b615c9fa3b8f3c77ec61d90 (diff) | |
download | mongo-9b2bf60ff8a768e609920cadc081a347e2f0eaa7.tar.gz |
SERVER-55823 move timeseries_create.js to noPassthrough
Diffstat (limited to 'jstests')
-rw-r--r-- | jstests/noPassthrough/timeseries_create.js (renamed from jstests/noPassthroughWithMongod/timeseries_create.js) | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/jstests/noPassthroughWithMongod/timeseries_create.js b/jstests/noPassthrough/timeseries_create.js index bfa413c0d05..08f5534ea5b 100644 --- a/jstests/noPassthroughWithMongod/timeseries_create.js +++ b/jstests/noPassthrough/timeseries_create.js @@ -11,11 +11,15 @@ load("jstests/core/timeseries/libs/timeseries.js"); -if (!TimeseriesTest.timeseriesCollectionsEnabled(db.getMongo())) { +const conn = MongoRunner.runMongod(); + +if (!TimeseriesTest.timeseriesCollectionsEnabled(conn)) { jsTestLog("Skipping test because the time-series collection feature flag is disabled"); + MongoRunner.stopMongod(conn); return; } +const dbName = jsTestName(); let collCount = 0; const testOptions = function(allowed, @@ -31,7 +35,7 @@ const testOptions = function(allowed, // passing all the test assertions. tearDown: (testDB, collName) => {}, }) { - const testDB = db.getSiblingDB(jsTestName()); + const testDB = conn.getDB(dbName); const collName = 'timeseries_' + collCount++; const bucketsCollName = 'system.buckets.' + collName; @@ -145,7 +149,7 @@ testTimeseriesNamespaceExists((testDB, collName) => { // Tests that schema validation is enabled on the bucket collection. { - const testDB = db.getSiblingDB(jsTestName()); + const testDB = conn.getDB(dbName); const coll = testDB.getCollection('timeseries_' + collCount++); assert.commandWorked( testDB.createCollection(coll.getName(), {timeseries: {timeField: "time"}})); @@ -174,4 +178,6 @@ testTimeseriesNamespaceExists((testDB, collName) => { ErrorCodes.DocumentValidationFailure); assert.commandWorked(testDB.runCommand({drop: coll.getName(), writeConcern: {w: "majority"}})); } + +MongoRunner.stopMongod(conn); })(); |