AleoNet / snarkOS

A Decentralized Operating System for ZK Applications

Home Page:http://snarkos.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug] test_connection_cleanups is flaky

vicsn opened this issue Β· comments

πŸ› Bug Report

It appears that sometimes, when a validator is picked in the test, it fails:

thread 'test_connection_cleanups' panicked at node/router/tests/cleanups.rs:74:9:
the deadline has elapsed for condition: tcp0.num_connected() == 1 && tcp1.num_connected() == 1
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

A quick print statement indicated: Unable to connect to '127.0.0.1:63168' - '127.0.0.1:63168' disconnected before sending "Message::ChallengeResponse"

Steps to Reproduce

cd node/router && cargo test test_connection_cleanups

Due to random sampling of the node type, the test only sometimes fails.

Expected Behavior

The test should pass.

Your Environment

Ran it on mainnet-staging 491f3078a

The fix is in #3164. Increasing the timeout a little ensures the test passes every time.

I may have spoken too soon, I'll investigate some more. It's less flaky with a longer timeout but it occasionally still fails πŸ€”