summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXiangyu Yao <xiangyu.yao@mongodb.com>2018-10-12 16:53:11 -0400
committerXiangyu Yao <xiangyu.yao@mongodb.com>2018-10-26 12:46:30 -0400
commit198f899d027bdcbaf99556f29c94f4cd3d3bcf3d (patch)
treee0529012a7e5bf4d6026d97e957be6f0193bb357
parent740fbec81e3176972cf20aa847c36bdf99aac27a (diff)
downloadmongo-198f899d027bdcbaf99556f29c94f4cd3d3bcf3d.tar.gz
SERVER-37618 Capture all the logs in lock_stats_suboperation_logs.js
(cherry picked from commit 399135312416e5fd5e541246855bdb87fcedd6aa)
-rw-r--r--jstests/noPassthrough/lock_stats_suboperation_logs.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/jstests/noPassthrough/lock_stats_suboperation_logs.js b/jstests/noPassthrough/lock_stats_suboperation_logs.js
index 067613c6726..515aad0baa7 100644
--- a/jstests/noPassthrough/lock_stats_suboperation_logs.js
+++ b/jstests/noPassthrough/lock_stats_suboperation_logs.js
@@ -62,6 +62,9 @@
dollarOutAggregationShell();
assert.eq(db['favorite'].count(), 1);
+ // Stopping the mongod also waits until all of its logs have been read by the mongo shell.
+ MongoRunner.stopMongod(conn);
+
let mongodLogs = rawMongoProgramOutput();
let lines = mongodLogs.split('\n');
const lockWaitTimeRegex = /timeAcquiringMicros: { [wW]: ([0-9]+)/;
@@ -69,7 +72,7 @@
let supposedLockWaitTime;
let numWaitedForLocks = 0;
- // Only the logs of 'parent' (aggregation with $out) and the first
+ // Only the logs of 'parent command' (aggregation with $out) and the first
// sub-operation(createCollection) have the information about the long wait for the lock.
for (let line of lines) {
if ((match = lockWaitTimeRegex.exec(line)) !== null) {
@@ -84,6 +87,4 @@
}
}
assert.eq(numWaitedForLocks, 2);
-
- MongoRunner.stopMongod(conn);
})();