summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Wahlin <james@mongodb.com>2020-11-04 15:30:04 -0500
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-07-26 21:17:12 +0000
commit85938f0ae7c81ecca90bdfd6addd2d9446cf0d3d (patch)
treeb8dec8313da2ee24f3d0178eaeea700156e6a7b7
parentfc1eff70e7ce3f0dd53b884246723982fe6b6aac (diff)
downloadmongo-85938f0ae7c81ecca90bdfd6addd2d9446cf0d3d.tar.gz
SERVER-6036 Adjust tests for cursor timeout to disable implicit session creation
(cherry picked from commit 317132d60584706c660164f74f51b81015ecdd72)
-rw-r--r--jstests/aggregation/bugs/cursor_timeout.js6
-rw-r--r--jstests/sharding/cursor1.js6
-rw-r--r--jstests/sharding/cursor_timeout.js2
3 files changed, 13 insertions, 1 deletions
diff --git a/jstests/aggregation/bugs/cursor_timeout.js b/jstests/aggregation/bugs/cursor_timeout.js
index e9b80b0597f..7664ecc54e4 100644
--- a/jstests/aggregation/bugs/cursor_timeout.js
+++ b/jstests/aggregation/bugs/cursor_timeout.js
@@ -40,6 +40,10 @@ const batchSize = 2;
const numMatches = 5;
function assertCursorTimesOut(collName, pipeline) {
+ // Cursor timeout only occurs outside of sessions. Otherwise we rely on the session timeout
+ // mechanism to kill cursors.
+ TestData.disableImplicitSessions = true;
+
const res = assert.commandWorked(testDB.runCommand({
aggregate: collName,
pipeline: pipeline,
@@ -71,6 +75,8 @@ function assertCursorTimesOut(collName, pipeline) {
cursor.itcount();
});
assert.eq(ErrorCodes.CursorNotFound, err.code, tojson(err));
+
+ TestData.disableImplicitSessions = false;
}
assert.commandWorked(testDB.source.insert({local: 1}));
diff --git a/jstests/sharding/cursor1.js b/jstests/sharding/cursor1.js
index b6070673ae8..07497051b44 100644
--- a/jstests/sharding/cursor1.js
+++ b/jstests/sharding/cursor1.js
@@ -25,6 +25,10 @@ assert.eq(1,
s.config.chunks.count({"ns": "test.foo"}),
"test requires collection to have one chunk initially");
+// Cursor timeout only occurs outside of sessions. Otherwise we rely on the session timeout
+// mechanism to kill cursors.
+TestData.disableImplicitSessions = true;
+
// we'll split the collection in two and move the second chunk while three cursors are open
// cursor1 still has more data in the first chunk, the one that didn't move
// cursor2 buffered the last obj of the first chunk
@@ -65,5 +69,7 @@ assert.soon(function() {
}
}, "cursor failed to time out", /*timeout*/ 30000, /*interval*/ 5000);
+TestData.disableImplicitSessions = false;
+
s.stop();
})();
diff --git a/jstests/sharding/cursor_timeout.js b/jstests/sharding/cursor_timeout.js
index 85e45d41bde..33ac660703e 100644
--- a/jstests/sharding/cursor_timeout.js
+++ b/jstests/sharding/cursor_timeout.js
@@ -14,7 +14,7 @@
// the session cursors #5 and #6 are attached to to simulate that session timing out, and ensures
// that cursors #5 and #6 are killed as a result.
//
-// @tags: [requires_sharding]
+// @tags: [requires_sharding, requires_find_command, requires_fcv_44]
(function() {
'use strict';