diff options
| author | Lucas de Castro Borges <lucas@gnuabordo.com.br> | 2025-02-14 14:26:38 -0300 |
|---|---|---|
| committer | Lucas de Castro Borges <lucas@gnuabordo.com.br> | 2025-02-14 14:26:38 -0300 |
| commit | 294bc6ecabf14c09c9bc8644704921dcf97cb44e (patch) | |
| tree | 279b1e0bab53901a1647ac63c1c724f0f789a663 /jstests/noPassthrough/collmod_ttl.js | |
| parent | 70be7c27a251621187a1de533462ae2bb1e3bd39 (diff) | |
| parent | 1e917fd798aa25b7066d4b414b51184f13d5a092 (diff) | |
Update upstream source from tag 'upstream/6.0.10'debian/6.0.10-1
Update to upstream version '6.0.10'
with Debian dir 2d176fa254eee97b139f712fec5709641335a8c3
Diffstat (limited to 'jstests/noPassthrough/collmod_ttl.js')
| -rw-r--r-- | jstests/noPassthrough/collmod_ttl.js | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/jstests/noPassthrough/collmod_ttl.js b/jstests/noPassthrough/collmod_ttl.js index f68e43b67b5..9464ec3284c 100644 --- a/jstests/noPassthrough/collmod_ttl.js +++ b/jstests/noPassthrough/collmod_ttl.js @@ -11,6 +11,8 @@ (function() { "use strict"; +load("jstests/libs/ttl_util.js"); + // Runs TTL monitor constantly to speed up this test. const conn = MongoRunner.runMongod({setParameter: 'ttlMonitorSleepSecs=1'}); @@ -21,21 +23,11 @@ assert.commandWorked(testDB.createCollection(coll.getName())); coll.createIndex({a: 1}); const expireAfterSeconds = 5; -const waitForTTL = () => { - // The 'ttl.passes' metric is incremented when the TTL monitor starts processing the indexes, so - // we wait for it to be incremented twice to know that the TTL monitor finished processing the - // indexes at least once. - const ttlPasses = testDB.serverStatus().metrics.ttl.passes; - assert.soon(function() { - return testDB.serverStatus().metrics.ttl.passes > ttlPasses + 1; - }); -}; - // Inserts a measurement older than the TTL expiry. The data should be found. const expired = new Date((new Date()).getTime() - (1000 * 10)); assert.commandWorked(coll.insert({a: expired})); -waitForTTL(); +TTLUtil.waitForPass(testDB); assert.eq(1, coll.find().itcount()); // Converts to a TTL index and checks the data is deleted. @@ -47,7 +39,7 @@ assert.commandWorked(testDB.runCommand({ } })); -waitForTTL(); +TTLUtil.waitForPass(testDB); assert.eq(0, coll.find().itcount()); MongoRunner.stopMongod(conn); |
