summaryrefslogtreecommitdiff
path: root/jstests/parallel/checkMultiThread.js
blob: 3f0bbe8d6e3b5f6cf12425303c8f48c98bdfe1cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
load('jstests/libs/parallelTester.js');

var start = new Date();
print("start: " + start);
var func = function() {
    db.runCommand({sleep: 1, seconds: 10000});
    return new Date();
};
a = new Thread(func);
b = new Thread(func);
a.start();
b.start();
a.join();
b.join();
assert.lt(a.returnData() - start, 15000, "A took more than 15s");
assert.lt(b.returnData() - start, 15000, "B took more than 15s");