summaryrefslogtreecommitdiff
path: root/jstests/noPassthrough/ttl_partial_index.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/noPassthrough/ttl_partial_index.js')
-rw-r--r--jstests/noPassthrough/ttl_partial_index.js7
1 files changed, 3 insertions, 4 deletions
diff --git a/jstests/noPassthrough/ttl_partial_index.js b/jstests/noPassthrough/ttl_partial_index.js
index 977eb4aef4c..00125a9bb91 100644
--- a/jstests/noPassthrough/ttl_partial_index.js
+++ b/jstests/noPassthrough/ttl_partial_index.js
@@ -2,6 +2,8 @@
// SERVER-17984.
(function() {
"use strict";
+load("jstests/libs/ttl_util.js");
+
// Launch mongod with shorter TTL monitor sleep interval.
var runner = MongoRunner.runMongod({setParameter: "ttlMonitorSleepSecs=1"});
var coll = runner.getDB("test").ttl_partial_index;
@@ -17,10 +19,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).
-var 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());
assert.eq(0,
coll.find({z: {$exists: true}}).hint({x: 1}).itcount(),