Companion for #6726 (#1469)

* Companion for #6726

* Spaces

* 'Update substrate'

Co-authored-by: parity-processbot <>
This commit is contained in:
Bastian Köcher
2020-07-26 15:16:09 +02:00
committed by GitHub
parent a2527913a6
commit fa598f176b
24 changed files with 278 additions and 204 deletions
+1 -1
View File
@@ -903,7 +903,7 @@ mod tests {
}
fn test_harness<T: Future<Output=()>>(keystore: KeyStorePtr, test: impl FnOnce(TestHarness) -> T) {
let pool = sp_core::testing::SpawnBlockingExecutor::new();
let pool = sp_core::testing::TaskExecutor::new();
let (context, virtual_overseer) = polkadot_subsystem::test_helpers::make_subsystem_context(pool.clone());
@@ -706,7 +706,7 @@ mod test {
signed_availability: signed.clone(),
};
let pool = sp_core::testing::SpawnBlockingExecutor::new();
let pool = sp_core::testing::TaskExecutor::new();
let (mut ctx, mut handle) =
make_subsystem_context::<BitfieldDistributionMessage, _>(pool);
@@ -766,7 +766,7 @@ mod test {
signed_availability: signed.clone(),
};
let pool = sp_core::testing::SpawnBlockingExecutor::new();
let pool = sp_core::testing::TaskExecutor::new();
let (mut ctx, mut handle) =
make_subsystem_context::<BitfieldDistributionMessage, _>(pool);
@@ -818,7 +818,7 @@ mod test {
signed_availability: signed_bitfield.clone(),
};
let pool = sp_core::testing::SpawnBlockingExecutor::new();
let pool = sp_core::testing::TaskExecutor::new();
let (mut ctx, mut handle) =
make_subsystem_context::<BitfieldDistributionMessage, _>(pool);
@@ -915,7 +915,7 @@ mod test {
signed_availability: signed_bitfield.clone(),
};
let pool = sp_core::testing::SpawnBlockingExecutor::new();
let pool = sp_core::testing::TaskExecutor::new();
let (mut ctx, mut handle) =
make_subsystem_context::<BitfieldDistributionMessage, _>(pool);
@@ -1052,7 +1052,7 @@ mod test {
// validator 0 key pair
let (mut state, _signing_context, _validator_pair) = state_with_view(view![], hash_a.clone());
let pool = sp_core::testing::SpawnBlockingExecutor::new();
let pool = sp_core::testing::TaskExecutor::new();
let (mut ctx, mut handle) =
make_subsystem_context::<BitfieldDistributionMessage, _>(pool);
+1 -1
View File
@@ -635,7 +635,7 @@ mod tests {
}
fn test_harness<T: Future<Output=()>>(test: impl FnOnce(TestHarness) -> T) {
let pool = sp_core::testing::SpawnBlockingExecutor::new();
let pool = sp_core::testing::TaskExecutor::new();
let (network, network_handle) = new_test_network();
let (context, virtual_overseer) = polkadot_subsystem::test_helpers::make_subsystem_context(pool);
@@ -619,7 +619,7 @@ mod tests {
our_view: View(vec![hash_a, hash_b]),
};
let pool = sp_core::testing::SpawnBlockingExecutor::new();
let pool = sp_core::testing::TaskExecutor::new();
let (mut ctx, mut handle) = polkadot_subsystem::test_helpers::make_subsystem_context(pool);
let mut descriptor = CandidateDescriptor::default();
descriptor.pov_hash = pov_hash;
@@ -699,7 +699,7 @@ mod tests {
our_view: View(vec![hash_a]),
};
let pool = sp_core::testing::SpawnBlockingExecutor::new();
let pool = sp_core::testing::TaskExecutor::new();
let (mut ctx, mut handle) = polkadot_subsystem::test_helpers::make_subsystem_context(pool);
let mut descriptor = CandidateDescriptor::default();
descriptor.pov_hash = pov_hash;
@@ -777,7 +777,7 @@ mod tests {
our_view: View(vec![hash_a]),
};
let pool = sp_core::testing::SpawnBlockingExecutor::new();
let pool = sp_core::testing::TaskExecutor::new();
let (mut ctx, mut handle) = polkadot_subsystem::test_helpers::make_subsystem_context(pool);
executor::block_on(async move {
@@ -849,7 +849,7 @@ mod tests {
our_view: View(vec![hash_a]),
};
let pool = sp_core::testing::SpawnBlockingExecutor::new();
let pool = sp_core::testing::TaskExecutor::new();
let (mut ctx, mut handle) = polkadot_subsystem::test_helpers::make_subsystem_context(pool);
executor::block_on(async move {
@@ -937,7 +937,7 @@ mod tests {
our_view: View(vec![hash_a]),
};
let pool = sp_core::testing::SpawnBlockingExecutor::new();
let pool = sp_core::testing::TaskExecutor::new();
let (mut ctx, mut handle) = polkadot_subsystem::test_helpers::make_subsystem_context(pool);
executor::block_on(async move {
@@ -1000,7 +1000,7 @@ mod tests {
our_view: View(vec![hash_a]),
};
let pool = sp_core::testing::SpawnBlockingExecutor::new();
let pool = sp_core::testing::TaskExecutor::new();
let (mut ctx, mut handle) = polkadot_subsystem::test_helpers::make_subsystem_context(pool);
executor::block_on(async move {
@@ -1061,7 +1061,7 @@ mod tests {
our_view: View(vec![hash_a]),
};
let pool = sp_core::testing::SpawnBlockingExecutor::new();
let pool = sp_core::testing::TaskExecutor::new();
let (mut ctx, mut handle) = polkadot_subsystem::test_helpers::make_subsystem_context(pool);
executor::block_on(async move {
@@ -1119,7 +1119,7 @@ mod tests {
our_view: View(vec![hash_a]),
};
let pool = sp_core::testing::SpawnBlockingExecutor::new();
let pool = sp_core::testing::TaskExecutor::new();
let (mut ctx, mut handle) = polkadot_subsystem::test_helpers::make_subsystem_context(pool);
executor::block_on(async move {
@@ -1204,7 +1204,7 @@ mod tests {
our_view: View(vec![hash_a, hash_b]),
};
let pool = sp_core::testing::SpawnBlockingExecutor::new();
let pool = sp_core::testing::TaskExecutor::new();
let (mut ctx, mut handle) = polkadot_subsystem::test_helpers::make_subsystem_context(pool);
executor::block_on(async move {
@@ -1266,7 +1266,7 @@ mod tests {
our_view: View(vec![hash_a]),
};
let pool = sp_core::testing::SpawnBlockingExecutor::new();
let pool = sp_core::testing::TaskExecutor::new();
let (mut ctx, mut handle) = polkadot_subsystem::test_helpers::make_subsystem_context(pool);
executor::block_on(async move {
@@ -1343,7 +1343,7 @@ mod tests {
our_view: View(vec![hash_a]),
};
let pool = sp_core::testing::SpawnBlockingExecutor::new();
let pool = sp_core::testing::TaskExecutor::new();
let (mut ctx, mut handle) = polkadot_subsystem::test_helpers::make_subsystem_context(pool);
executor::block_on(async move {
@@ -1426,7 +1426,7 @@ mod tests {
our_view: View(vec![hash_a]),
};
let pool = sp_core::testing::SpawnBlockingExecutor::new();
let pool = sp_core::testing::TaskExecutor::new();
let (mut ctx, mut handle) = polkadot_subsystem::test_helpers::make_subsystem_context(pool);
executor::block_on(async move {
@@ -1212,7 +1212,7 @@ mod tests {
},
};
let pool = sp_core::testing::SpawnBlockingExecutor::new();
let pool = sp_core::testing::TaskExecutor::new();
let (mut ctx, mut handle) = polkadot_subsystem::test_helpers::make_subsystem_context(pool);
let peer = PeerId::random();
@@ -1304,7 +1304,7 @@ mod tests {
(peer_c.clone(), peer_data_from_view(peer_c_view)),
].into_iter().collect();
let pool = sp_core::testing::SpawnBlockingExecutor::new();
let pool = sp_core::testing::TaskExecutor::new();
let (mut ctx, mut handle) = polkadot_subsystem::test_helpers::make_subsystem_context(pool);
executor::block_on(async move {
@@ -135,7 +135,7 @@ impl<C> Subsystem<C> for Subsystem2
fn main() {
femme::with_level(femme::LevelFilter::Trace);
let spawner = sp_core::testing::SpawnBlockingExecutor::new();
let spawner = sp_core::testing::TaskExecutor::new();
futures::executor::block_on(async {
let timer_stream = stream::repeat(()).then(|_| async {
Delay::new(Duration::from_secs(1)).await;
+5 -5
View File
@@ -485,7 +485,7 @@ where
/// }
///
/// # fn main() { executor::block_on(async move {
/// let spawner = sp_core::testing::SpawnBlockingExecutor::new();
/// let spawner = sp_core::testing::TaskExecutor::new();
/// let all_subsystems = AllSubsystems {
/// candidate_validation: ValidationSubsystem,
/// candidate_backing: DummySubsystem,
@@ -1058,7 +1058,7 @@ mod tests {
// Checks that a minimal configuration of two jobs can run and exchange messages.
#[test]
fn overseer_works() {
let spawner = sp_core::testing::SpawnBlockingExecutor::new();
let spawner = sp_core::testing::TaskExecutor::new();
executor::block_on(async move {
let (s1_tx, mut s1_rx) = mpsc::channel(64);
@@ -1123,7 +1123,7 @@ mod tests {
// Should immediately conclude the overseer itself with an error.
#[test]
fn overseer_panics_on_subsystem_exit() {
let spawner = sp_core::testing::SpawnBlockingExecutor::new();
let spawner = sp_core::testing::TaskExecutor::new();
executor::block_on(async move {
let (s1_tx, _) = mpsc::channel(64);
@@ -1218,7 +1218,7 @@ mod tests {
// notifications on imported blocks triggers expected `StartWork` and `StopWork` heartbeats.
#[test]
fn overseer_start_stop_works() {
let spawner = sp_core::testing::SpawnBlockingExecutor::new();
let spawner = sp_core::testing::TaskExecutor::new();
executor::block_on(async move {
let first_block_hash = [1; 32].into();
@@ -1314,7 +1314,7 @@ mod tests {
// notifications on imported blocks triggers expected `StartWork` and `StopWork` heartbeats.
#[test]
fn overseer_finalize_works() {
let spawner = sp_core::testing::SpawnBlockingExecutor::new();
let spawner = sp_core::testing::TaskExecutor::new();
executor::block_on(async move {
let first_block_hash = [1; 32].into();
+1 -1
View File
@@ -891,7 +891,7 @@ mod tests {
type OverseerHandle = test_helpers::TestSubsystemContextHandle<CandidateSelectionMessage>;
fn test_harness<T: Future<Output=()>>(run_args: HashMap<Hash, Vec<FromJob>>, test: impl FnOnce(OverseerHandle, mpsc::Receiver<(Option<Hash>, JobsError<Error>)>) -> T) {
let pool = sp_core::testing::SpawnBlockingExecutor::new();
let pool = sp_core::testing::TaskExecutor::new();
let (context, overseer_handle) = make_subsystem_context(pool.clone());
let (err_tx, err_rx) = mpsc::channel(16);