summaryrefslogtreecommitdiff
path: root/jstests/noPassthrough/ttl_resharding_collection.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/noPassthrough/ttl_resharding_collection.js')
-rw-r--r--jstests/noPassthrough/ttl_resharding_collection.js7
1 files changed, 3 insertions, 4 deletions
diff --git a/jstests/noPassthrough/ttl_resharding_collection.js b/jstests/noPassthrough/ttl_resharding_collection.js
index 648d1a9b056..cafa433fa5f 100644
--- a/jstests/noPassthrough/ttl_resharding_collection.js
+++ b/jstests/noPassthrough/ttl_resharding_collection.js
@@ -1,6 +1,8 @@
// Tests that the TTL Monitor is disabled for <database>.system.resharding.* namespaces.
(function() {
"use strict";
+load("jstests/libs/ttl_util.js");
+
// Launch mongod with shorter TTL monitor sleep interval.
const runner = MongoRunner.runMongod({setParameter: "ttlMonitorSleepSecs=1"});
const collName = "system.resharding.mycoll";
@@ -14,10 +16,7 @@ assert.commandWorked(coll.insert({x: now}));
// Wait for the TTL monitor to run at least twice (in case we weren't finished setting up our
// collection when it ran the first time).
-const ttlPass = coll.getDB().serverStatus().metrics.ttl.passes;
-assert.soon(function() {
- return coll.getDB().serverStatus().metrics.ttl.passes >= ttlPass + 2;
-}, "TTL monitor didn't run before timing out.");
+TTLUtil.waitForPass(coll.getDB());
// Confirm the document was not removed because it was in a <database>.system.resharding.*
// namespace.