summaryrefslogtreecommitdiff
path: root/src/mongo/shell/assert.js
diff options
context:
space:
mode:
authorMax Hirschhorn <max.hirschhorn@mongodb.com>2018-05-25 22:07:24 -0400
committerMax Hirschhorn <max.hirschhorn@mongodb.com>2018-05-25 22:07:24 -0400
commit25f72cf5f1d0d894680ef855f646e27f234ce6a3 (patch)
tree6d6db543f58eaf808332c50d3491a1e24ddffdf9 /src/mongo/shell/assert.js
parentf0e5229b631668c9bde511e607bf52fd871e582d (diff)
downloadmongo-25f72cf5f1d0d894680ef855f646e27f234ce6a3.tar.gz
SERVER-34779 Add hook for checking dbhash while a test is running.
Enables the CheckReplDBHashInBackground hook in the replica_sets_jscore_passthrough.yml test suite. Also fixes the WTPreserveSnapshotHistoryIndefinitely failpoint to ignore attempts from _decreaseTargetSnapshotWindowSize() to move the oldest timestamp forward.
Diffstat (limited to 'src/mongo/shell/assert.js')
-rw-r--r--src/mongo/shell/assert.js14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/mongo/shell/assert.js b/src/mongo/shell/assert.js
index bfb3a25bc17..dbd1b01c2cf 100644
--- a/src/mongo/shell/assert.js
+++ b/src/mongo/shell/assert.js
@@ -6,10 +6,12 @@ doassert = function(msg, obj) {
if (typeof(msg) == "object")
msg = tojson(msg);
- if (typeof(msg) == "string" && msg.indexOf("assert") == 0)
- print(msg);
- else
- print("assert: " + msg);
+ if (jsTest.options().traceExceptions) {
+ if (typeof(msg) == "string" && msg.indexOf("assert") == 0)
+ print(msg);
+ else
+ print("assert: " + msg);
+ }
var ex;
if (obj) {
@@ -17,7 +19,9 @@ doassert = function(msg, obj) {
} else {
ex = Error(msg);
}
- print(ex.stack);
+ if (jsTest.options().traceExceptions) {
+ print(ex.stack);
+ }
throw ex;
};