summaryrefslogtreecommitdiff
path: root/jstests/libs/kill_sessions.js
diff options
context:
space:
mode:
authorBlake Oler <blake.oler@mongodb.com>2019-09-23 21:41:15 +0000
committerevergreen <evergreen@mongodb.com>2019-09-23 21:41:15 +0000
commitc4162d244b9a031b077cc3694f8585288e275ff6 (patch)
treea2ca678ee9ddd0a8a679a8db6502b02f02e4e329 /jstests/libs/kill_sessions.js
parent89f0a9ab0b0328937ceeb9af5f55566421447759 (diff)
downloadmongo-c4162d244b9a031b077cc3694f8585288e275ff6.tar.gz
SERVER-43210 Allow time for cursors to indicate that a session has been killed in the killSessions helper
Diffstat (limited to 'jstests/libs/kill_sessions.js')
-rw-r--r--jstests/libs/kill_sessions.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/jstests/libs/kill_sessions.js b/jstests/libs/kill_sessions.js
index ae9978c271e..865d993ff0c 100644
--- a/jstests/libs/kill_sessions.js
+++ b/jstests/libs/kill_sessions.js
@@ -183,10 +183,11 @@ var _kill_sessions_api_module = (function() {
this.visit(function(client) {
var db = client.getDB("admin");
db.setSlaveOk();
- var cursors =
- db.aggregate([{"$currentOp": {"idleCursors": true, "allUsers": true}}]).toArray();
- cursors.forEach(function(cursor) {
- assert(!cursor.lsid);
+ assert.soon(() => {
+ let cursors = db.aggregate([
+ {"$currentOp": {"idleCursors": true, "allUsers": true}}
+ ]).toArray();
+ return cursors.every(cursor => !cursor.lsid);
});
});
};