diff options
author | vrachev <vlad.rachev@mongodb.com> | 2020-06-16 15:59:11 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-06-22 18:43:58 +0000 |
commit | 18f88ce0680ab946760b599437977ffd60c49678 (patch) | |
tree | 5b97c2415a201492838806191011e24ea6249044 /jstests/resmoke_selftest | |
parent | c88f09756902f7833cacf5b1af7ee18bca80eddd (diff) | |
download | mongo-18f88ce0680ab946760b599437977ffd60c49678.tar.gz |
SERVER-48705 resmoke.py sending SIGABRT to take core dumps on fixture teardown may overwrite core files from hang analyzer.
Adds an option to the hang-analyzer to kill processes after finishing analysis.
Updates assert.soon's usage of the hang-analyzer to use this option.
Diffstat (limited to 'jstests/resmoke_selftest')
-rw-r--r-- | jstests/resmoke_selftest/shell_hang_analyzer.js | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/jstests/resmoke_selftest/shell_hang_analyzer.js b/jstests/resmoke_selftest/shell_hang_analyzer.js index 9fc58b628cd..189f6fe1bba 100644 --- a/jstests/resmoke_selftest/shell_hang_analyzer.js +++ b/jstests/resmoke_selftest/shell_hang_analyzer.js @@ -17,17 +17,21 @@ const anyLineMatches = function(lines, rex) { */ const child = MongoRunner.runMongod(); -try { - clearRawMongoProgramOutput(); +clearRawMongoProgramOutput(); - // drive-by test for enable(). Separate test for disable() below. - MongoRunner.runHangAnalyzer.disable(); - MongoRunner.runHangAnalyzer.enable(); +// drive-by test for enable(). Separate test for disable() below. +MongoRunner.runHangAnalyzer.disable(); +MongoRunner.runHangAnalyzer.enable(); - MongoRunner.runHangAnalyzer([child.pid]); +MongoRunner.runHangAnalyzer([child.pid]); - const lines = rawMongoProgramOutput().split('\n'); +if (TestData && TestData.inEvergreen) { + assert.soon(() => { + // Ensure the hang-analyzer has killed the process. + return !checkProgram(child.pid).alive; + }); + const lines = rawMongoProgramOutput().split('\n'); if (_isAddressSanitizerActive()) { assert.soon(() => { // On ASAN builds, we never dump the core during hang analyzer runs, @@ -42,7 +46,8 @@ try { return anyLineMatches(lines, /Dumping core/); }); } -} finally { +} else { + // When running locally the hang-analyzer is not run. MongoRunner.stopMongod(child); } })(); |