summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHana Pearlman <hana.pearlman@mongodb.com>2021-02-11 14:32:16 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-02-11 17:54:07 +0000
commitf0e718fa4174d0a26eff3a3993089af9d745f622 (patch)
tree0799ad31590fedd875914bf5683fc87fd6a00d69
parentf4b7d9465834ab88e25190088512c1a46131b57d (diff)
downloadmongo-f0e718fa4174d0a26eff3a3993089af9d745f622.tar.gz
SERVER-54182: Add logging to improve debugging of aggregation_currentop.js
-rw-r--r--jstests/sharding/query/aggregation_currentop.js16
1 files changed, 9 insertions, 7 deletions
diff --git a/jstests/sharding/query/aggregation_currentop.js b/jstests/sharding/query/aggregation_currentop.js
index 01a9ad8d146..8557751d0c2 100644
--- a/jstests/sharding/query/aggregation_currentop.js
+++ b/jstests/sharding/query/aggregation_currentop.js
@@ -339,13 +339,15 @@ function runCommonTests(conn, curOpSpec) {
// Test that {idleConnections: false} returns only active connections.
const idleConn = new Mongo(conn.host);
- assert.eq(adminDB
- .aggregate([
- {$currentOp: addToSpec({allUsers: true, idleConnections: false})},
- {$match: {active: false}}
- ])
- .itcount(),
- 0);
+ const activeConns = adminDB
+ .aggregate([
+ {$currentOp: addToSpec({allUsers: true, idleConnections: false})},
+ {$match: {active: false}}
+ ])
+ .toArray();
+ assert.eq(activeConns.length,
+ 0,
+ "$currentOp should report 0 active connections but found:\n" + tojson(activeConns));
// Test that the currentOp command with {$all: false} returns only active connections.
assert.eq(adminDB.currentOp({$ownOps: false, $all: false, active: false}).inprog.length, 0);