use of com.linkedin.parseq.BaseTask in project parseq by linkedin.
the class TestTaskToTrace method testUnfinishedTrace.
@Test
public void testUnfinishedTrace() throws InterruptedException {
// Used to ensure that the task has started running
final CountDownLatch cdl = new CountDownLatch(1);
final SettablePromise<Void> promise = Promises.settable();
final Task<Void> task = new BaseTask<Void>() {
@Override
public Promise<Void> run(final Context context) throws Exception {
cdl.countDown();
// Return a promise that won't be satisfied until after out test
return promise;
}
};
getEngine().run(task);
assertTrue(cdl.await(5, TimeUnit.SECONDS));
logTracingResults("TestTaskToTrace.testUnfinishedTrace", task);
verifyShallowTrace(task);
// Finish task
promise.done(null);
}
Aggregations