diff options
author | James Wahlin <james.wahlin@10gen.com> | 2016-11-21 11:50:28 -0500 |
---|---|---|
committer | James Wahlin <james.wahlin@10gen.com> | 2016-11-22 12:34:09 -0500 |
commit | 18ff331c446023d25cb349e757f063bdd83c9cf9 (patch) | |
tree | 46e281fddd73de16f9231e54cd5aca60e6cf2398 /jstests/aggregation | |
parent | 18af91c3e560418c5f7d0694d8350993bd812fc8 (diff) | |
download | mongo-18ff331c446023d25cb349e757f063bdd83c9cf9.tar.gz |
SERVER-27090 cursor_timeout.js sets cursorTimeoutMillis incorrectly
(cherry picked from commit 4d301a60b68fcc7cfad8499a0fe60c758da45f3e)
Diffstat (limited to 'jstests/aggregation')
-rw-r--r-- | jstests/aggregation/bugs/cursor_timeout.js | 15 |
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)); |