mirror of
https://github.com/mimblewimble/grin.git
synced 2025-01-21 03:21:08 +03:00
complete the 'simulate_seeding' test case for automatic test (#1441)
complete the 'simulate_seeding' test case for automatic test
This commit is contained in:
parent
da0100bffb
commit
9a127d6291
1 changed files with 22 additions and 2 deletions
|
@ -105,6 +105,9 @@ fn simulate_seeding() {
|
|||
|
||||
pool.create_server(&mut server_config);
|
||||
|
||||
// wait the seed server fully start up before start remaining servers
|
||||
thread::sleep(time::Duration::from_millis(1_000));
|
||||
|
||||
// point next servers at first seed
|
||||
server_config.is_seeding = false;
|
||||
server_config.seed_addr = String::from(format!(
|
||||
|
@ -116,10 +119,27 @@ fn simulate_seeding() {
|
|||
pool.create_server(&mut server_config);
|
||||
}
|
||||
|
||||
// pool.connect_all_peers();
|
||||
|
||||
let servers = pool.run_all_servers();
|
||||
thread::sleep(time::Duration::from_secs(5));
|
||||
|
||||
// Check they all end up connected.
|
||||
let url = format!("http://{}:{}/v1/peers/all", &server_config.base_addr, 30020);
|
||||
let peers_all = api::client::get::<Vec<p2p::PeerData>>(url.as_str());
|
||||
assert!(peers_all.is_ok());
|
||||
assert_eq!(
|
||||
peers_all
|
||||
.unwrap()
|
||||
.iter()
|
||||
.filter(|x| x.flags == p2p::State::Healthy)
|
||||
.collect::<Vec<&p2p::PeerData>>()
|
||||
.len(),
|
||||
4
|
||||
);
|
||||
|
||||
stop_all_servers(servers);
|
||||
|
||||
// wait servers fully stop before start next automated test
|
||||
thread::sleep(time::Duration::from_millis(1_000));
|
||||
}
|
||||
|
||||
/// Create 1 server, start it mining, then connect 4 other peers mining and
|
||||
|
|
Loading…
Reference in a new issue