diff options
Diffstat (limited to 'jstests/libs/clustered_collections/clustered_capped_utils.js')
| -rw-r--r-- | jstests/libs/clustered_collections/clustered_capped_utils.js | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/jstests/libs/clustered_collections/clustered_capped_utils.js b/jstests/libs/clustered_collections/clustered_capped_utils.js index e9c136f57fd..8e6ae836223 100644 --- a/jstests/libs/clustered_collections/clustered_capped_utils.js +++ b/jstests/libs/clustered_collections/clustered_capped_utils.js @@ -1,5 +1,3 @@ -load("jstests/libs/ttl_util.js"); - var ClusteredCappedUtils = class { // Validate TTL-based deletion on a clustered, capped collection. static testClusteredCappedCollectionWithTTL(db, collName, clusterKeyField) { @@ -41,8 +39,7 @@ var ClusteredCappedUtils = class { } assert.commandWorked(coll.insertMany(docs, {ordered: true})); - // This test runs with default read concern 'local'. - TTLUtil.waitForPass(db, /*waitForMajorityCommit=*/false); + ClusteredCollectionUtil.waitForTTL(db); // Only the recent documents survived. assert.eq(coll.find().itcount(), batchSize); @@ -143,7 +140,7 @@ var ClusteredCappedUtils = class { // TTL delete the two old documents. assert.commandWorked(db.adminCommand({setParameter: 1, ttlMonitorEnabled: true})); - TTLUtil.waitForPass(db, /*waitForMajorityCommit=*/isReplicated); + ClusteredCollectionUtil.waitForTTL(db); assert.eq(2, db.getCollection(collName).find().itcount()); // Confirm that the tailable getMore can resume from where it was, since the document the @@ -212,7 +209,7 @@ var ClusteredCappedUtils = class { // TTL delete the two old documents, while the tailable cursor is still on the first one. assert.commandWorked(db.adminCommand({setParameter: 1, ttlMonitorEnabled: true})); - TTLUtil.waitForPass(db, /*waitForMajorityCommit=*/isReplicated); + ClusteredCollectionUtil.waitForTTL(db); assert.eq(1, db.getCollection(collName).find().itcount()); // Confirm that the tailable cursor returns CappedPositionLost, as the document it was @@ -295,8 +292,7 @@ var ClusteredCappedUtils = class { // Expire the document. assert.commandWorked(db.adminCommand({setParameter: 1, ttlMonitorEnabled: true})); - // No need to wait for majority commit, as default 'local' read concern is used. - TTLUtil.waitForPass(db, /*waitForMajorityCommit=*/false); + ClusteredCollectionUtil.waitForTTL(db); assert.eq(0, db.getCollection(collName).find().itcount()); // The TTL deletion has been replicated to the oplog. |
