summaryrefslogtreecommitdiff
path: root/jstests/aggregation/bugs
diff options
context:
space:
mode:
authorJames Wahlin <james.wahlin@10gen.com>2016-11-21 11:50:28 -0500
committerJames Wahlin <james.wahlin@10gen.com>2016-11-22 08:55:11 -0500
commit4d301a60b68fcc7cfad8499a0fe60c758da45f3e (patch)
tree6f456d019de48cb8b87cba96d6da6f497ec1dc1e /jstests/aggregation/bugs
parent9bb919e988166f5e08aeb0f394842c8afe5ae03f (diff)
downloadmongo-4d301a60b68fcc7cfad8499a0fe60c758da45f3e.tar.gz
SERVER-27090 cursor_timeout.js sets cursorTimeoutMillis incorrectly
Diffstat (limited to 'jstests/aggregation/bugs')
-rw-r--r--jstests/aggregation/bugs/cursor_timeout.js15
1 files changed, 11 insertions, 4 deletions
diff --git a/jstests/aggregation/bugs/cursor_timeout.js b/jstests/aggregation/bugs/cursor_timeout.js
index 0e46e399397..95bf90040dd 100644
--- a/jstests/aggregation/bugs/cursor_timeout.js
+++ b/jstests/aggregation/bugs/cursor_timeout.js
@@ -6,6 +6,14 @@
(function() {
'use strict';
+ // Cursor timeout on mongod is handled by a single thread/timer that will sleep for
+ // "clientCursorMonitorFrequencySecs" and add the sleep value to each operation's duration when
+ // it wakes up, timing out those whose "now() - last accessed since" time exceeds. A cursor
+ // timeout of 2 seconds with a monitor frequency of 1 second means an effective timeout period
+ // of 1 to 2 seconds.
+ const cursorTimeoutMs = 2000;
+ const cursorMonitorFrequencySecs = 1;
+
const options = {
setParameter: {
internalDocumentSourceCursorBatchSizeBytes: 1,
@@ -14,8 +22,8 @@
// server parameter to make the ClientCursorMonitor that cleans up the timed out cursors
// run more often. The combination of these server parameters reduces the amount of time
// we need to wait within this test.
- cursorTimeoutMillis: 1000,
- clientCursorMonitorFrequencySecs: 1,
+ cursorTimeoutMillis: cursorTimeoutMs,
+ clientCursorMonitorFrequencySecs: cursorMonitorFrequencySecs,
}
};
const conn = MongoRunner.runMongod(options);
@@ -50,8 +58,7 @@
},
function() {
return "aggregation cursor failed to time out: " + tojson(serverStatus);
- },
- 5000);
+ });
assert.eq(0, serverStatus.metrics.cursor.open.total, tojson(serverStatus));