jobs: don't early exit when there are no jobs (#1621)

* jobs: don't early exit when there are no jobs

* utils: fix merged test

* utils: less verbose

* utils: add an assert subsystem is running

* utils: use TimeoutExt from test-helpers

* test-helpers: use TimeoutExt
This commit is contained in:
Andronik Ordian
2020-08-21 16:45:39 +02:00
committed by GitHub
parent 44354e717b
commit e899a3f844
2 changed files with 46 additions and 33 deletions
@@ -275,16 +275,13 @@ pub fn subsystem_test_harness<M, OverseerFactory, Overseer, TestFactory, Test>(
let overseer = overseer_factory(handle);
let test = test_factory(context);
let timeout = Delay::new(Duration::from_secs(2));
futures::pin_mut!(overseer, test, timeout);
futures::pin_mut!(overseer, test);
futures::executor::block_on(async move {
futures::select! {
_ = overseer.fuse() => (),
_ = test.fuse() => (),
_ = timeout.fuse() => panic!("test timed out instead of completing"),
}
future::join(overseer, test)
.timeout(Duration::from_secs(2))
.await
.expect("test timed out instead of completing")
});
}