mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 15:51:12 +00:00
Upgrade tokio to 1.22.0 and replace async-std with tokio (#12646)
* Replace deprecated libp2p feature specs with correct ones * Bump tokio to 1.21.2 * Replace async-std libp2p primitives with tokio ones * minor: rustfmt * Fix TestNet to run initialization in the tokio context * Convert telemetry test from async-std to tokio * Convert notifications tests from async-std to tokio * Convert chain sync tests from async-std to tokio * Ditch async-std completely * Make executor mandatory * Bump tokio to 1.22.0 * minor: rustfmt * Explicitly use tokio runtime in tests * Move more tests to explicit tokio runtime * Explicitly set multithreaded runtime in tokio test * minor: rustfmt * minor: fix comment * Replace async-std with tokio in MMR tests
This commit is contained in:
@@ -308,7 +308,6 @@ impl<B: BlockT> futures::future::FusedFuture for GossipEngine<B> {
|
||||
mod tests {
|
||||
use super::*;
|
||||
use crate::{multiaddr::Multiaddr, ValidationResult, ValidatorContext};
|
||||
use async_std::task::spawn;
|
||||
use futures::{
|
||||
channel::mpsc::{unbounded, UnboundedSender},
|
||||
executor::{block_on, block_on_stream},
|
||||
@@ -490,8 +489,8 @@ mod tests {
|
||||
}))
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn keeps_multiple_subscribers_per_topic_updated_with_both_old_and_new_messages() {
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn keeps_multiple_subscribers_per_topic_updated_with_both_old_and_new_messages() {
|
||||
let topic = H256::default();
|
||||
let protocol = ProtocolName::from("/my_protocol");
|
||||
let remote_peer = PeerId::random();
|
||||
@@ -541,8 +540,10 @@ mod tests {
|
||||
.start_send(events[1].clone())
|
||||
.expect("Event stream is unbounded; qed.");
|
||||
|
||||
spawn(gossip_engine);
|
||||
tokio::spawn(gossip_engine);
|
||||
|
||||
// Note: `block_on_stream()`-derived iterator will block the current thread,
|
||||
// so we need a `multi_thread` `tokio::test` runtime flavor.
|
||||
let mut subscribers =
|
||||
subscribers.into_iter().map(|s| block_on_stream(s)).collect::<Vec<_>>();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user