Skip to content

fix(dkg): flanky test keymanager - #628

Open
iamquang95 wants to merge 1 commit into
mainfrom
feat/fix-keymanager-test
Open

fix(dkg): flanky test keymanager#628
iamquang95 wants to merge 1 commit into
mainfrom
feat/fix-keymanager-test

Conversation

@iamquang95

Copy link
Copy Markdown
Collaborator

Problem

dkg::tests::verify_keymanager_connection_fails_for_unreachable_address is flaky under parallel test runs. It binds 127.0.0.1:0 to get an ephemeral port, drops the listener, then connects expecting failure. Between release and connect, the kernel can hand the same port to another process (e.g. a concurrent test suite binding :0); since the production check is TCP-handshake-only, the connection succeeds and the test fails with unreachable keymanager should fail.

Solution

Dial http://127.0.0.1:0 directly. Port 0 is only meaningful as a bind request ("assign me a port") and is never assigned to a listener, so as a connect destination it fails unconditionally — no probe-then-release window, no port for a competing process to occupy. Deterministic by construction; no retries, sleeps, or serialization. Test-only change; the DkgError::Keymanager assertion is preserved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant