Fix import queue thread pool shutdown (#4929)

* Fix import queue thread pool shutdown

* Make sure runtime is disposed before telemetry

* Close channel istead of sending a message

* Fixed test
This commit is contained in:
Arkadiy Paronyan
2020-02-17 10:49:40 +01:00
committed by GitHub
parent c7b09b642a
commit c8fa6518bf
5 changed files with 78 additions and 14 deletions
+9 -2
View File
@@ -229,7 +229,7 @@ impl Verifier<TestBlock> for TestVerifier {
) -> Result<(BlockImportParams<TestBlock, ()>, Option<Vec<(CacheKeyId, Vec<u8>)>>), String> {
// apply post-sealing mutations (i.e. stripping seal, if desired).
(self.mutator)(&mut header, Stage::PostSeal);
Ok(self.inner.verify(origin, header, justification, body).expect("verification failed!"))
self.inner.verify(origin, header, justification, body)
}
}
@@ -423,7 +423,14 @@ fn run_one_test(
}
runtime.spawn(futures01::future::poll_fn(move || {
net.lock().poll();
let mut net = net.lock();
net.poll();
for p in net.peers() {
for (h, e) in p.failed_verifications() {
panic!("Verification failed for {:?}: {}", h, e);
}
}
Ok::<_, ()>(futures01::Async::NotReady::<()>)
}));