diff --git a/src/mongo/shell/assert.js b/src/mongo/shell/assert.js
|
index 2ce8e1e..c159a7e 100644
|
--- a/src/mongo/shell/assert.js
|
+++ b/src/mongo/shell/assert.js
|
@@ -36,6 +36,11 @@ assert = function(b, msg) {
|
};
|
|
assert.automsg = function(b) {
|
+ if (typeof b === "string") {
|
+ if (/\b(for|while)\b/.test(b)) {
|
+ throw new Error("Passed a stringified expression to evaluate: " + b);
|
+ }
|
+ }
|
assert(eval(b), b);
|
};
|
|
@@ -119,6 +124,16 @@ assert.docEq = function(a, b, msg) {
|
};
|
|
assert.eq.automsg = function(a, b) {
|
+ if (typeof a === "string") {
|
+ if (/\b(for|while)\b/.test(a)) {
|
+ throw new Error("Passed a stringified expression to evaluate: " + a);
|
+ }
|
+ }
|
+ if (typeof b === "string") {
|
+ if (/\b(for|while)\b/.test(b)) {
|
+ throw new Error("Passed a stringified expression to evaluate: " + b);
|
+ }
|
+ }
|
assert.eq(eval(a), eval(b), "[" + a + "] != [" + b + "]");
|
};
|
|
diff --git a/src/mongo/shell/servers_misc.js b/src/mongo/shell/servers_misc.js
|
index 223d7d2..846030e 100644
|
--- a/src/mongo/shell/servers_misc.js
|
+++ b/src/mongo/shell/servers_misc.js
|
@@ -229,6 +229,16 @@ function startParallelShell(jsCode, port, noConnect) {
|
if (typeof(jsCode) == "function") {
|
jsCode = "(" + jsCode.toString() + ")();";
|
} else if (typeof(jsCode) == "string") {
|
+ if (/\b(for|while)\b/.test(jsCode)) {
|
+ const conn = port ? new Mongo("localhost:" + port) : db;
|
+ while (true) {
|
+ const res = conn.getDB("admin").runCommand({fsyncUnlock: 1});
|
+ if (res.ok || res.errmsg === "fsyncUnlock called when not locked") {
|
+ break;
|
+ }
|
+ }
|
+ throw new Error("Passed a stringified expression to evaluate: " + jsCode);
|
+ }
|
}
|
// do nothing
|
else {
|
diff --git a/test_server27642.yml b/test_server27642.yml
|
new file mode 100644
|
index 0000000..cf8b1d1
|
--- /dev/null
|
+++ b/test_server27642.yml
|
@@ -0,0 +1,109 @@
|
+selector:
|
+ js_test:
|
+ roots:
|
+ - jstests/auth/killop_own_ops.js
|
+ - jstests/core/compact_keeps_indexes.js
|
+ - jstests/core/count10.js
|
+ - jstests/core/count_plan_summary.js
|
+ - jstests/core/coveredIndex3.js
|
+ - jstests/core/currentop.js
|
+ - jstests/core/cursora.js
|
+ - jstests/core/distinct3.js
|
+ - jstests/core/evalc.js
|
+ - jstests/core/evald.js
|
+ - jstests/core/explain3.js
|
+ - jstests/core/find_and_modify_concurrent_update.js
|
+ - jstests/core/fsync.js
|
+ - jstests/core/geo_update_btree.js
|
+ - jstests/core/group6.js
|
+ - jstests/core/in6.js
|
+ - jstests/core/index1.js
|
+ - jstests/core/index_check6.js
|
+ - jstests/core/kill_cursors.js
|
+ - jstests/core/killop.js
|
+ - jstests/core/killop_drop_collection.js
|
+ - jstests/core/loadserverscripts.js
|
+ - jstests/core/max_time_ms.js
|
+ - jstests/core/mr_killop.js
|
+ - jstests/core/numberint.js
|
+ - jstests/core/numberlong.js
|
+ - jstests/core/or4.js
|
+ - jstests/core/or5.js
|
+ - jstests/core/or7.js
|
+ - jstests/core/or8.js
|
+ - jstests/core/or9.js
|
+ - jstests/core/ora.js
|
+ - jstests/core/orb.js
|
+ - jstests/core/queryoptimizer3.js
|
+ - jstests/core/remove9.js
|
+ - jstests/core/removeb.js
|
+ - jstests/core/removec.js
|
+ - jstests/core/shellstartparallel.js
|
+ - jstests/core/update_arraymatch6.js
|
+ - jstests/core/updatef.js
|
+ - jstests/disk/killall.js
|
+ - jstests/disk/repair.js
|
+ - jstests/disk/repair2.js
|
+ - jstests/disk/repair3.js
|
+ - jstests/disk/repair4.js
|
+ - jstests/disk/repair5.js
|
+ - jstests/dur/closeall.js
|
+ - jstests/libs/override_methods/set_majority_read_and_write_concerns.js
|
+ - jstests/libs/test_background_ops.js
|
+ - jstests/mmap_v1/capped7.js
|
+ - jstests/mmap_v1/indexh.js
|
+ - jstests/noPassthrough/currentop_query.js
|
+ - jstests/noPassthrough/index_killop.js
|
+ - jstests/noPassthrough/index_no_retry.js
|
+ - jstests/noPassthrough/index_retry.js
|
+ - jstests/noPassthrough/lock_stats.js
|
+ - jstests/noPassthrough/query_yield1.js
|
+ - jstests/noPassthrough/query_yield2.js
|
+ - jstests/noPassthrough/read_majority.js
|
+ - jstests/noPassthrough/repair2.js
|
+ - jstests/noPassthrough/update_server-5552.js
|
+ - jstests/noPassthrough/write_local.js
|
+ - jstests/noPassthrough/wt_nojournal_skip_recovery.js
|
+ - jstests/noPassthrough/wt_nojournal_toggle.js
|
+ - jstests/noPassthroughWithMongod/connections_opened.js
|
+ - jstests/noPassthroughWithMongod/dup_bgindex.js
|
+ - jstests/noPassthroughWithMongod/explain1.js
|
+ - jstests/noPassthroughWithMongod/explain2.js
|
+ - jstests/noPassthroughWithMongod/explain3.js
|
+ - jstests/noPassthroughWithMongod/indexbg_updates.js
|
+ - jstests/parallel/update_serializability1.js
|
+ - jstests/parallel/update_serializability2.js
|
+ - jstests/repl/repair.js
|
+ - jstests/repl/repl1.js
|
+ - jstests/repl/repl2.js
|
+ - jstests/replsets/clean_shutdown_oplog_state.js
|
+ - jstests/replsets/get_replication_info_helper.js
|
+ - jstests/replsets/initialsync_with_write_load.js
|
+ - jstests/replsets/linearizable_read_concern.js
|
+ - jstests/replsets/maintenance.js
|
+ - jstests/replsets/read_after_optime.js
|
+ - jstests/replsets/replsets_killop.js
|
+ - jstests/replsets/resync_with_write_load.js
|
+ - jstests/replsets/shutdown_primary.js
|
+ - jstests/replsets/stepdown3.js
|
+ - jstests/replsets/stepdown_kill_other_ops.js
|
+ - jstests/replsets/stepdown_killop.js
|
+ - jstests/replsets/stepdown_long_wait_time.js
|
+ - jstests/replsets/write_concern_after_stepdown.js
|
+ - jstests/replsets/write_concern_after_stepdown_and_stepup.js
|
+ - jstests/serial_run/index_multi.js
|
+ - jstests/sharding/delete_during_migrate.js
|
+ - jstests/sharding/features3.js
|
+ - jstests/sharding/sharding_migrate_cursor1.js
|
+ - jstests/slow1/conc_update.js
|
+
|
+executor:
|
+ js_test:
|
+ config:
|
+ shell_options:
|
+ readMode: commands
|
+ fixture:
|
+ class: MongoDFixture
|
+ mongod_options:
|
+ set_parameters:
|
+ enableTestCommands: 1
|