Skip to content

Commit a1d4a4d

Browse files
authored
fix(iroh): Try to fix flaky test_token_passthrough test (#1419)
## Description This seems to fail often on CI on the emulated platforms when the machines are busy. And the failures we see are timeouts. So very likely increasing this timeout should help. Does a few smaller fixes: - Only bind on localhost instead of exposing us to the world. Tests should not expose themselves to the world. - Make sure that the receiver dropping is caught in a panic. ## Notes & open questions ## Change checklist - [x] Self-review. - [x] ~~Documentation updates if relevant.~~ - [x] Tests if relevant.
1 parent 2c6ab29 commit a1d4a4d

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

iroh/tests/provide.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -877,7 +877,7 @@ async fn test_token_passthrough() -> Result<()> {
877877
let rt = test_runtime();
878878
let expected = b"hello".to_vec();
879879
let (db, hash) = create_test_db([("test", expected.clone())]);
880-
let addr = "0.0.0.0:0".parse().unwrap();
880+
let addr = SocketAddr::from((Ipv4Addr::LOCALHOST, 0));
881881
let node = test_node(db, addr)
882882
.custom_auth_handler(Arc::new(CustomAuthHandler))
883883
.runtime(&rt)
@@ -894,7 +894,7 @@ async fn test_token_passthrough() -> Result<()> {
894894
if let iroh_bytes::provider::Event::GetRequestReceived { token: tok, .. } =
895895
bp_msg
896896
{
897-
events_sender.send(tok).ok();
897+
events_sender.send(tok).expect("receiver dropped");
898898
}
899899
}
900900
}
@@ -905,7 +905,7 @@ async fn test_token_passthrough() -> Result<()> {
905905

906906
let addrs = node.local_endpoint_addresses().await?;
907907
let peer_id = node.peer_id();
908-
tokio::time::timeout(Duration::from_secs(10), async move {
908+
tokio::time::timeout(Duration::from_secs(30), async move {
909909
let endpoint = MagicEndpoint::builder()
910910
.secret_key(SecretKey::generate())
911911
.keylog(true)

0 commit comments

Comments
 (0)