From ed4b3ef47144a00d5a654e142571d7e34a487faa Mon Sep 17 00:00:00 2001 From: Age Manning Date: Tue, 9 Jun 2020 07:27:06 +1000 Subject: [PATCH] Cleanup logs, increase test timeouts, remove gossipsub tests (#1247) * Cleanup logs, increase test timeouts, remove gossipsub tests * Fix compile issue Co-authored-by: Paul Hauner --- beacon_node/eth2-libp2p/src/peer_manager/peerdb.rs | 7 +------ beacon_node/eth2-libp2p/tests/gossipsub_tests.rs | 5 +++++ beacon_node/eth2-libp2p/tests/rpc_tests.rs | 12 ++++++------ 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/beacon_node/eth2-libp2p/src/peer_manager/peerdb.rs b/beacon_node/eth2-libp2p/src/peer_manager/peerdb.rs index 38a1fa39b..b5aa2cb3d 100644 --- a/beacon_node/eth2-libp2p/src/peer_manager/peerdb.rs +++ b/beacon_node/eth2-libp2p/src/peer_manager/peerdb.rs @@ -233,7 +233,6 @@ impl PeerDB { info.connection_status = PeerConnectionStatus::Dialing { since: Instant::now(), }; - debug!(self.log, "Peer dialing in db"; "peer_id" => peer_id.to_string(), "n_dc" => self.n_dc); } /// Update min ttl of a peer. @@ -280,7 +279,6 @@ impl PeerDB { self.n_dc = self.n_dc.saturating_sub(1); } info.connection_status.connect_ingoing(); - debug!(self.log, "Peer connected to db"; "peer_id" => peer_id.to_string(), "n_dc" => self.n_dc); } /// Sets a peer as connected with an outgoing connection. @@ -291,7 +289,6 @@ impl PeerDB { self.n_dc = self.n_dc.saturating_sub(1); } info.connection_status.connect_outgoing(); - debug!(self.log, "Peer connected to db"; "peer_id" => peer_id.to_string(), "n_dc" => self.n_dc); } /// Sets the peer as disconnected. A banned peer remains banned @@ -306,7 +303,6 @@ impl PeerDB { info.connection_status.disconnect(); self.n_dc += 1; } - debug!(self.log, "Peer disconnected from db"; "peer_id" => peer_id.to_string(), "n_dc" => self.n_dc); self.shrink_to_fit(); } @@ -338,7 +334,6 @@ impl PeerDB { if info.connection_status.is_disconnected() { self.n_dc = self.n_dc.saturating_sub(1); } - debug!(self.log, "Peer banned"; "peer_id" => peer_id.to_string(), "n_dc" => self.n_dc); info.connection_status.ban(); } @@ -411,7 +406,7 @@ mod tests { } fn get_db() -> PeerDB { - let log = build_log(slog::Level::Debug, true); + let log = build_log(slog::Level::Debug, false); PeerDB::new(&log) } diff --git a/beacon_node/eth2-libp2p/tests/gossipsub_tests.rs b/beacon_node/eth2-libp2p/tests/gossipsub_tests.rs index 3fcd9b701..809920a56 100644 --- a/beacon_node/eth2-libp2p/tests/gossipsub_tests.rs +++ b/beacon_node/eth2-libp2p/tests/gossipsub_tests.rs @@ -1,3 +1,7 @@ +/* These are temporarily disabled due to their non-deterministic behaviour and impending update to + * gossipsub 1.1. We leave these here as a template for future test upgrades + + #![cfg(test)] use crate::types::GossipEncoding; use ::types::{BeaconBlock, EthSpec, MinimalEthSpec, Signature, SignedBeaconBlock}; @@ -164,3 +168,4 @@ async fn test_gossipsub_full_mesh_publish() { } } } +*/ diff --git a/beacon_node/eth2-libp2p/tests/rpc_tests.rs b/beacon_node/eth2-libp2p/tests/rpc_tests.rs index 7cd5b059f..7218a64c0 100644 --- a/beacon_node/eth2-libp2p/tests/rpc_tests.rs +++ b/beacon_node/eth2-libp2p/tests/rpc_tests.rs @@ -94,7 +94,7 @@ async fn test_status_rpc() { tokio::select! { _ = sender_future => {} _ = receiver_future => {} - _ = delay_for(Duration::from_millis(800)) => { + _ = delay_for(Duration::from_millis(2000)) => { panic!("Future timed out"); } } @@ -204,7 +204,7 @@ async fn test_blocks_by_range_chunked_rpc() { tokio::select! { _ = sender_future => {} _ = receiver_future => {} - _ = delay_for(Duration::from_millis(800)) => { + _ = delay_for(Duration::from_millis(2000)) => { panic!("Future timed out"); } } @@ -334,7 +334,7 @@ async fn test_blocks_by_range_chunked_rpc_terminates_correctly() { tokio::select! { _ = sender_future => {} _ = receiver_future => {} - _ = delay_for(Duration::from_millis(50000)) => { + _ = delay_for(Duration::from_millis(2000)) => { panic!("Future timed out"); } } @@ -555,7 +555,7 @@ async fn test_blocks_by_root_chunked_rpc() { tokio::select! { _ = sender_future => {} _ = receiver_future => {} - _ = delay_for(Duration::from_millis(1000)) => { + _ = delay_for(Duration::from_millis(2000)) => { panic!("Future timed out"); } } @@ -694,7 +694,7 @@ async fn test_blocks_by_root_chunked_rpc_terminates_correctly() { tokio::select! { _ = sender_future => {} _ = receiver_future => {} - _ = delay_for(Duration::from_millis(1000)) => { + _ = delay_for(Duration::from_millis(2000)) => { panic!("Future timed out"); } } @@ -752,7 +752,7 @@ async fn test_goodbye_rpc() { tokio::select! { _ = sender_future => {} _ = receiver_future => {} - _ = delay_for(Duration::from_millis(1000)) => { + _ = delay_for(Duration::from_millis(2000)) => { panic!("Future timed out"); } }