diff options
Diffstat (limited to 'src/mongo/shell/assert.js')
-rw-r--r-- | src/mongo/shell/assert.js | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/mongo/shell/assert.js b/src/mongo/shell/assert.js index 657f6742f49..7749172f0ad 100644 --- a/src/mongo/shell/assert.js +++ b/src/mongo/shell/assert.js @@ -344,6 +344,14 @@ assert = (function() { assert.soon = function(func, msg, timeout, interval, {runHangAnalyzer = true} = {}) { _validateAssertionMessage(msg); + var msgPrefix = "assert.soon failed: " + func; + + if (msg) { + if (typeof (msg) != "function") { + msgPrefix = "assert.soon failed, msg"; + } + } + var start = new Date(); if (TestData && TestData.inEvergreen) { @@ -354,14 +362,6 @@ assert = (function() { interval = interval || 200; - var msgPrefix = "assert.soon (timeout " + timeout + "ms) failed: " + func; - - if (msg) { - if (typeof (msg) != "function") { - msgPrefix = "assert.soon (timeout " + timeout + "ms) failed, msg"; - } - } - while (1) { if (typeof (func) == "string") { if (eval(func)) |