diff options
author | Yu Jin Kang Park <yujin.kang@mongodb.com> | 2022-03-30 14:14:23 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-03-30 15:17:14 +0000 |
commit | 84befbcce9ba114af5c2eef117042b449c2017a8 (patch) | |
tree | b8fd4fc07a3332279c5b105d2c4bef468c48064d | |
parent | b52ac902f140dba84dd104f76153f3bd08077a97 (diff) | |
download | mongo-84befbcce9ba114af5c2eef117042b449c2017a8.tar.gz |
SERVER-64241: Make ttlMonitorSleepSecs change effective immediately. Speedup timeseries_expire.js
-rwxr-xr-x | buildscripts/resmokeconfig/suites/cst_jscore_passthrough.yml | 4 | ||||
-rw-r--r-- | jstests/noPassthrough/timeseries_expire.js (renamed from jstests/core/timeseries/timeseries_expire.js) | 17 |
2 files changed, 12 insertions, 9 deletions
diff --git a/buildscripts/resmokeconfig/suites/cst_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/cst_jscore_passthrough.yml index ac000fef42d..23a4531ca12 100755 --- a/buildscripts/resmokeconfig/suites/cst_jscore_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/cst_jscore_passthrough.yml @@ -783,10 +783,6 @@ selector: - jstests/core/exists9.js - jstests/core/exists8.js - # Timeseries collection expireAfterSeconds option requires the TTL Monitor, - # which is disabled in this test configuration. - - jstests/core/timeseries/timeseries_expire.js - # TODO SERVER-54042 Time-series collection queries - jstests/core/timeseries/timeseries_bucket_limit_count.js - jstests/core/timeseries/timeseries_min_max.js diff --git a/jstests/core/timeseries/timeseries_expire.js b/jstests/noPassthrough/timeseries_expire.js index 02f3020a6ed..8f4ce8564e6 100644 --- a/jstests/core/timeseries/timeseries_expire.js +++ b/jstests/noPassthrough/timeseries_expire.js @@ -10,20 +10,25 @@ (function() { "use strict"; +load('jstests/libs/fixture_helpers.js'); // For 'FixtureHelpers' load("jstests/core/timeseries/libs/timeseries.js"); +const conn = MongoRunner.runMongod({setParameter: 'ttlMonitorSleepSecs=1'}); +const testDB = conn.getDB(jsTestName()); +assert.commandWorked(testDB.dropDatabase()); + TimeseriesTest.run((insert) => { - const coll = db.timeseries_expire; - const bucketsColl = db.getCollection('system.buckets.' + coll.getName()); + const coll = testDB.timeseries_expire; + const bucketsColl = testDB.getCollection('system.buckets.' + coll.getName()); coll.drop(); const timeFieldName = 'time'; - const expireAfterSeconds = NumberLong(5); - assert.commandWorked(db.createCollection( + const expireAfterSeconds = NumberLong(1); + assert.commandWorked(testDB.createCollection( coll.getName(), {timeseries: {timeField: timeFieldName}, expireAfterSeconds: expireAfterSeconds})); - assert.contains(bucketsColl.getName(), db.getCollectionNames()); + assert.contains(bucketsColl.getName(), testDB.getCollectionNames()); // Inserts a measurement with a time in the past to ensure the measurement will be removed // immediately. @@ -46,4 +51,6 @@ TimeseriesTest.run((insert) => { const bucketDocs = bucketsColl.find().sort({'control.min._id': 1}).toArray(); assert.eq(0, bucketDocs.length, bucketDocs); }); + +MongoRunner.stopMongod(conn); })(); |