lib.rs 61.8 KiB
Newer Older
			handler.send_msg(AllMessages::RuntimeApi(test_runtime_api_msg())).await.unwrap();
			handler.send_msg(AllMessages::AvailabilityStore(test_availability_store_msg())).await.unwrap();
			handler.send_msg(AllMessages::NetworkBridge(test_network_bridge_msg())).await.unwrap();
			handler.send_msg(AllMessages::ChainApi(test_chain_api_msg())).await.unwrap();

			// send a stop signal to each subsystems
			handler.stop().await.unwrap();

			select! {
				res = overseer_fut => {
ordian's avatar
ordian committed
					const NUM_SUBSYSTEMS: usize = 15;

					assert_eq!(stop_signals_received.load(atomic::Ordering::SeqCst), NUM_SUBSYSTEMS);
					// x2 because of broadcast_signal on startup
					assert_eq!(signals_received.load(atomic::Ordering::SeqCst), 2 * NUM_SUBSYSTEMS);
					// -1 for BitfieldSigning
					assert_eq!(msgs_received.load(atomic::Ordering::SeqCst), NUM_SUBSYSTEMS - 1);

					assert!(res.is_ok());
				},
				complete => (),
			}
		});
	}
Fedor Sakharov's avatar
Fedor Sakharov committed
}