summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--jstests/sharding/read_pref_cmd.js2
-rw-r--r--jstests/sharding/zbigMapReduce.js2
-rw-r--r--src/mongo/shell/utils.js4
3 files changed, 5 insertions, 3 deletions
diff --git a/jstests/sharding/read_pref_cmd.js b/jstests/sharding/read_pref_cmd.js
index 555615fb5df..099630fa5c3 100644
--- a/jstests/sharding/read_pref_cmd.js
+++ b/jstests/sharding/read_pref_cmd.js
@@ -241,7 +241,7 @@ var testBadMode = function(conn, hostList, isMongos, mode, tagSets) {
testDB.runReadCommand({distinct: 'user', key: 'x'});
failureMsg = "Unexpected success running distinct!";
} catch (e) {
- jsTest.log(e);
+ jsTest.log(e.toString());
}
if (failureMsg)
diff --git a/jstests/sharding/zbigMapReduce.js b/jstests/sharding/zbigMapReduce.js
index cfa67f2d16f..88e8e6a5b8f 100644
--- a/jstests/sharding/zbigMapReduce.js
+++ b/jstests/sharding/zbigMapReduce.js
@@ -141,7 +141,7 @@ function runTest(s) {
db.foo.mapReduce(map, reduce, {out: {replace: "big_out", nonAtomic: true}});
});
- jsTest.log();
+ jsTest.log("Adding documents");
// Add docs with dup "i"
valInc = 0;
diff --git a/src/mongo/shell/utils.js b/src/mongo/shell/utils.js
index 6d130491b29..aabea87554f 100644
--- a/src/mongo/shell/utils.js
+++ b/src/mongo/shell/utils.js
@@ -304,7 +304,9 @@ setJsTestOption = function(name, value) {
};
jsTestLog = function(msg) {
- print("\n\n----\n" + msg + "\n----\n\n");
+ assert.eq(typeof(msg), "string", "Received: " + msg);
+ const msgs = ["----", ...msg.split("\n"), "----"].map(s => `[jsTest] ${s}`);
+ print(`\n\n${msgs.join("\n")}\n\n`);
};
jsTest = {};