2010-01-06 00:13:43 +01:00
|
|
|
// perform basic js tests in parallel & some other tasks as well
|
2016-02-04 18:30:13 +01:00
|
|
|
load('jstests/libs/parallelTester.js');
|
2010-01-06 00:13:43 +01:00
|
|
|
|
|
|
|
var c = db.jstests_parallel_basicPlus;
|
|
|
|
c.drop();
|
|
|
|
|
|
|
|
Random.setRandomSeed();
|
|
|
|
|
2016-03-09 18:17:50 +01:00
|
|
|
var params = ParallelTester.createJstestsLists(4);
|
2010-01-06 00:13:43 +01:00
|
|
|
var t = new ParallelTester();
|
2016-03-09 18:17:50 +01:00
|
|
|
for (i in params) {
|
|
|
|
t.add(ParallelTester.fileTester, params[i]);
|
2010-01-06 00:13:43 +01:00
|
|
|
}
|
|
|
|
|
2016-03-09 18:17:50 +01:00
|
|
|
for (var i = 4; i < 8; ++i) {
|
|
|
|
var g = new EventGenerator(i, "jstests_parallel_basicPlus", Random.randInt(20));
|
|
|
|
for (var j = (i - 4) * 3000; j < (i - 3) * 3000; ++j) {
|
|
|
|
var expected = j - ((i - 4) * 3000);
|
|
|
|
g.addCheckCount(expected,
|
|
|
|
{_id: {$gte: ((i - 4) * 3000), $lt: ((i - 3) * 3000)}},
|
|
|
|
expected % 1000 == 0,
|
|
|
|
expected % 500 == 0);
|
|
|
|
g.addInsert({_id: j});
|
2010-01-06 00:58:25 +01:00
|
|
|
}
|
2016-03-09 18:17:50 +01:00
|
|
|
t.add(EventGenerator.dispatch, g.getEvents());
|
2010-01-06 00:58:25 +01:00
|
|
|
}
|
2010-01-06 00:13:43 +01:00
|
|
|
|
2016-03-09 18:17:50 +01:00
|
|
|
t.run("one or more tests failed", true);
|
2010-01-06 00:13:43 +01:00
|
|
|
|
2016-03-09 18:17:50 +01:00
|
|
|
assert(c.validate().valid, "validate failed");
|
|
|
|
db.getCollectionNames().forEach(function(x) {
|
|
|
|
v = db[x].validate();
|
|
|
|
assert(v.valid, "validate failed for " + x + " with " + tojson(v));
|
|
|
|
});
|