Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion node/core/provisioner/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ polkadot-node-subsystem-util = { path = "../../subsystem-util" }
[dev-dependencies]
lazy_static = "1.4"
sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" }
tokio = "0.2"
futures-timer = "3.0.2"
9 changes: 4 additions & 5 deletions node/core/provisioner/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,7 @@ mod tests {
}

mod select_candidates {
use futures_timer::Delay;
use super::super::*;
use super::{build_occupied_core, default_bitvec, occupied_core, scheduled_core};
use polkadot_node_subsystem::messages::RuntimeApiRequest::{
Expand Down Expand Up @@ -675,9 +676,7 @@ mod tests {

futures::pin_mut!(overseer, test);

tokio::runtime::Runtime::new()
.unwrap()
.block_on(future::select(overseer, test));
futures::executor::block_on(future::select(overseer, test));
}

// For test purposes, we always return this set of availability cores:
Expand Down Expand Up @@ -784,12 +783,12 @@ mod tests {
// drop the receiver so it closes and the sender can't send, then just sleep long enough that
// this is almost certainly not the first of the two futures to complete
std::mem::drop(rx);
tokio::time::delay_for(std::time::Duration::from_secs(1)).await;
Delay::new(std::time::Duration::from_secs(1)).await;
};

let test = |mut tx: mpsc::Sender<FromJob>| async move {
// wait so that the overseer can drop the rx before we attempt to send
tokio::time::delay_for(std::time::Duration::from_millis(50)).await;
Delay::new(std::time::Duration::from_millis(50)).await;
let result = select_candidates(&[], &[], &[], Default::default(), &mut tx).await;
println!("{:?}", result);
assert!(std::matches!(result, Err(Error::OneshotSend)));
Expand Down