diff options
author | Xiangyu Yao <xiangyu.yao@mongodb.com> | 2018-10-12 16:53:11 -0400 |
---|---|---|
committer | Xiangyu Yao <xiangyu.yao@mongodb.com> | 2018-10-26 12:45:14 -0400 |
commit | 260d6135b0ea55e076091ed80618a1ede0534207 (patch) | |
tree | 9df73240f29275a0ed6df873c219a8321c629fb9 | |
parent | 5a430ff9c35752e932cd9ce52e90a4a4cad49cea (diff) | |
download | mongo-260d6135b0ea55e076091ed80618a1ede0534207.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.js | 7 |
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 b74b7662afc..21f16a614e7 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); })(); |