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();
|
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
|
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();
|
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");
|