Upgrade tokio to 1.10 (#9575)

* Upgrade tokio to 1.10

* Fix test runner

* Try fix it

* Update Cargo.lock

* Review feedback

* ahhhh

* FML

* FMT

* Fix tests
This commit is contained in:
Bastian Köcher
2021-08-24 16:31:19 +02:00
committed by GitHub
parent d722c44248
commit f92e5c5e65
24 changed files with 143 additions and 378 deletions
@@ -45,7 +45,7 @@ sp-timestamp = { path = "../../../primitives/timestamp", version = "4.0.0-dev" }
prometheus-endpoint = { package = "substrate-prometheus-endpoint", path = "../../../utils/prometheus", version = "0.9.0" }
[dev-dependencies]
tokio = { version = "0.2", features = ["rt-core", "macros"] }
tokio = { version = "1.10.0", features = ["rt-multi-thread", "macros"] }
sc-basic-authorship = { path = "../../basic-authorship", version = "0.10.0-dev" }
substrate-test-runtime-client = { path = "../../../test-utils/runtime/client", version = "2.0.0" }
substrate-test-runtime-transaction-pool = { path = "../../../test-utils/runtime/transaction-pool", version = "2.0.0" }
@@ -308,7 +308,7 @@ mod tests {
consensus_data_provider: None,
});
std::thread::spawn(|| {
let mut rt = tokio::runtime::Runtime::new().unwrap();
let rt = tokio::runtime::Runtime::new().unwrap();
// spawn the background authorship task
rt.block_on(future);
});
@@ -365,7 +365,7 @@ mod tests {
create_inherent_data_providers: |_, _| async { Ok(()) },
});
std::thread::spawn(|| {
let mut rt = tokio::runtime::Runtime::new().unwrap();
let rt = tokio::runtime::Runtime::new().unwrap();
// spawn the background authorship task
rt.block_on(future);
});
@@ -443,7 +443,7 @@ mod tests {
create_inherent_data_providers: |_, _| async { Ok(()) },
});
std::thread::spawn(|| {
let mut rt = tokio::runtime::Runtime::new().unwrap();
let rt = tokio::runtime::Runtime::new().unwrap();
// spawn the background authorship task
rt.block_on(future);
});