2019-03-11 18:17:29 -04:00
|
|
|
// @tags: [
|
|
|
|
|
// requires_fastcount,
|
|
|
|
|
// uses_multiple_connections,
|
|
|
|
|
// ]
|
2018-04-06 10:33:03 -04:00
|
|
|
|
2011-01-01 17:29:27 -05:00
|
|
|
function f() {
|
2014-05-14 19:43:38 -04:00
|
|
|
throw Error("intentional_throw_to_test_assert_throws");
|
2011-01-01 17:29:27 -05:00
|
|
|
}
|
|
|
|
|
assert.throws(f);
|
|
|
|
|
|
|
|
|
|
// verify that join works
|
|
|
|
|
db.sps.drop();
|
2015-06-23 22:22:52 -04:00
|
|
|
var awaitShell = startParallelShell("sleep(1000); db.sps.insert({x:1});");
|
|
|
|
|
awaitShell();
|
2011-01-03 11:42:01 -08:00
|
|
|
assert.eq(1, db.sps.count(), "join problem?");
|
2011-01-01 17:29:27 -05:00
|
|
|
|
|
|
|
|
// test with a throw
|
2015-06-23 22:22:52 -04:00
|
|
|
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");
|
2011-01-03 11:42:01 -08:00
|
|
|
assert.eq(2, db.sps.count(), "join2 problem?");
|
2011-01-01 21:53:06 -05:00
|
|
|
|
|
|
|
|
print("shellstartparallel.js SUCCESS");
|