summaryrefslogtreecommitdiff
path: root/jstests/core/shell/shellstartparallel.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/core/shell/shellstartparallel.js')
-rw-r--r--jstests/core/shell/shellstartparallel.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/jstests/core/shell/shellstartparallel.js b/jstests/core/shell/shellstartparallel.js
new file mode 100644
index 00000000000..e86d4690401
--- /dev/null
+++ b/jstests/core/shell/shellstartparallel.js
@@ -0,0 +1,24 @@
+// @tags: [
+// requires_fastcount,
+// uses_multiple_connections,
+// uses_parallel_shell,
+// ]
+
+function f() {
+ throw Error("intentional_throw_to_test_assert_throws");
+}
+assert.throws(f);
+
+// verify that join works
+db.sps.drop();
+var awaitShell = startParallelShell("sleep(1000); db.sps.insert({x:1});");
+awaitShell();
+assert.eq(1, db.sps.count(), "join problem?");
+
+// test with a throw
+awaitShell = startParallelShell("db.sps.insert({x:1}); throw Error('intentionally_uncaught');");
+var exitCode = awaitShell({checkExitSuccess: false});
+assert.neq(0, exitCode, "expected shell to exit abnormally due to an uncaught exception");
+assert.eq(2, db.sps.count(), "join2 problem?");
+
+print("shellstartparallel.js SUCCESS");