Skip to content

Instantly share code, notes, and snippets.

@kevinAlbs
Created July 21, 2016 17:29
Show Gist options
  • Save kevinAlbs/5423d11759f084f6925c3b3d1ffd0332 to your computer and use it in GitHub Desktop.
Save kevinAlbs/5423d11759f084f6925c3b3d1ffd0332 to your computer and use it in GitHub Desktop.
diff --git a/jstests/noPassthrough/ttl_capped.js b/jstests/noPassthrough/ttl_capped.js
index c5b26c0..7fcda75 100644
--- a/jstests/noPassthrough/ttl_capped.js
+++ b/jstests/noPassthrough/ttl_capped.js
@@ -11,7 +11,8 @@
var conn = MongoRunner.runMongod({
dbpath: dbpath,
noCleanData: true,
- setParameter: "ttlMonitorSleepSecs=1",
+ setParameter: "ttlMonitorSleepSecs=0", // This logs many more "TTL monitor is disabled"
+ // messages, so pipe to grep -v "disabled".
});
assert.neq(null, conn, "mongod was unable to start up");
@@ -31,6 +32,11 @@
// that the TTL monitor continues processing the remaining collections after encountering an
// error processing a capped collection.
for (var i = 0; i < numCollectionsToCreate; i++) {
+ if (i == numCollectionsToCreate - 1) {
+ // Reset the time here, a tiny bit before the TTL monitor is enabled to give it enough
+ // time to call sleep() before being enabled.
+ assert.commandWorked(testDB.adminCommand({setParameter: 1, ttlMonitorSleepSecs: 1}));
+ }
var collName = "ttl" + i.zeroPad(width);
if (i % 3 === 1) {
assert.commandWorked(testDB.createCollection(collName, {capped: true, size: 4096}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment