From 9fb1edd400526809c917e99ac4cfb6c9473baf72 Mon Sep 17 00:00:00 2001 From: Mikhail Shchatko Date: Thu, 13 Feb 2020 11:18:03 +0300 Subject: SERVER-46029 Do not write core files in the hang analyzer when running locally (sans Evergreen) --- src/mongo/shell/assert.js | 16 +++++++++++----- src/mongo/shell/servers.js | 5 +++++ src/mongo/shell/utils.js | 1 + 3 files changed, 17 insertions(+), 5 deletions(-) (limited to 'src/mongo') diff --git a/src/mongo/shell/assert.js b/src/mongo/shell/assert.js index 07bf0c31bfd..2c34209c2fa 100644 --- a/src/mongo/shell/assert.js +++ b/src/mongo/shell/assert.js @@ -323,7 +323,13 @@ assert = (function() { } var start = new Date(); - timeout = timeout || 5 * 60 * 1000; + + if (TestData.inEvergreen) { + timeout = timeout || 10 * 60 * 1000; + } else { + timeout = timeout || 60 * 1000; + } + interval = interval || 200; var last; while (1) { @@ -340,10 +346,10 @@ assert = (function() { msg = _buildAssertionMessage(msg, msgPrefix); if (runHangAnalyzer) { msg = msg + - "The hang analyzer is automatically called in assert.soon functions. " + - "If you are *expecting* assert.soon to possibly fail, call assert.soon " + - "with {runHangAnalyzer: false} as the fifth argument " + - "(you can fill unused arguments with `undefined`)."; + " The hang analyzer is automatically called in assert.soon functions." + + " If you are *expecting* assert.soon to possibly fail, call assert.soon" + + " with {runHangAnalyzer: false} as the fifth argument" + + " (you can fill unused arguments with `undefined`)."; print(msg + " Running hang analyzer from assert.soon."); MongoRunner.runHangAnalyzer(); } diff --git a/src/mongo/shell/servers.js b/src/mongo/shell/servers.js index 679b42463c9..e8da72e8ba0 100644 --- a/src/mongo/shell/servers.js +++ b/src/mongo/shell/servers.js @@ -123,6 +123,11 @@ function runHangAnalyzer(pids) { return; } + if (!TestData.inEvergreen) { + print('Skipping runHangAnalyzer: not running in Evergreen'); + return; + } + if (!_hangAnalyzerEnabled) { print('Skipping runHangAnalyzer: manually disabled'); return; diff --git a/src/mongo/shell/utils.js b/src/mongo/shell/utils.js index 05c61f2a2eb..f1472995fc0 100644 --- a/src/mongo/shell/utils.js +++ b/src/mongo/shell/utils.js @@ -359,6 +359,7 @@ jsTestOptions = function() { alwaysUseLogFiles: TestData.alwaysUseLogFiles || false, skipCheckOrphans: TestData.skipCheckOrphans || false, isAsanBuild: TestData.isAsanBuild, + inEvergreen: TestData.inEvergreen || false, }); } return _jsTestOptions; -- cgit v1.2.1