Files
mongo/jstests/shellstartparallel.js

18 lines
491 B
JavaScript
Raw Normal View History

2011-01-01 17:29:27 -05:00
function f() {
throw "intentional_throw_to_test_assert_throws";
}
assert.throws(f);
// verify that join works
db.sps.drop();
2011-01-10 10:57:37 -08:00
join = startParallelShell("sleep(1000); db.sps.insert({x:1}); db.getLastError();");
2011-01-01 17:29:27 -05:00
join();
assert.eq(1, db.sps.count(), "join problem?");
2011-01-01 17:29:27 -05:00
// test with a throw
2011-01-10 10:57:37 -08:00
join = startParallelShell("db.sps.insert({x:1}); db.getLastError(); throw 'intentionally_uncaught';");
2011-01-01 17:29:27 -05:00
join();
assert.eq(2, db.sps.count(), "join2 problem?");
2011-01-01 21:53:06 -05:00
print("shellstartparallel.js SUCCESS");