Commit a9e0da00 authored by Noah Orensa's avatar Noah Orensa
Browse files

run onInit and onComplete in workers

parent 0587f1f5
......@@ -27,7 +27,9 @@ void DistributedUnitTest::_workerRun() {
sandbox().resourceSnapshot(_usedResources);
_status = Status::FAIL;
timeOf(_onInit);
_workerBodyTime = timeOf(_workerBody);
timeOf(_onComplete);
_status = Status::PASS;
sandbox().resourceSnapshot(_usedResources);
......
......@@ -332,3 +332,16 @@ dunit("distributed-unit-test", "runaway-allocations-during-message")
run = false;
t.join();
});
static bool initialized = false;
dunit("distributed-unit-test", "onInit")
.onInit([] {
initialized = true;
})
.workers(1)
.driver([] {
assert(initialized);
})
.worker([] {
assert(initialized);
});
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment