Skip to content

test(desktop-linux): destroy fake VNC sockets so a port prober cannot hang close - #487

Merged
ElbertePlinio merged 1 commit into
mainfrom
fix/480-viewer-state-stalled-connect
Oct 30, 2026
Merged

ElbertePlinio merged 1 commit into
mainfrom
fix/480-viewer-state-stalled-connect

Conversation

@ElbertePlinio

@ElbertePlinio ElbertePlinio commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

The stalled-connect test in viewer-state.test.ts sometimes timed out in afterEach. The hook waits for server.close() on the fake VNC servers, and that wait did not end.

A local port prober caused it. While the test waits 2 s, a process on the host connected to the fake server's loopback port and kept its end open. On the author's machine this was an IDE port detector. The fake server only half-closed its side with socket.end("RFB"), so the open connection held server.close() open. The server now destroys each socket after the RFB write.

Closes #480

No device pass: this changes one test helper and no product behavior.

Requirement Verification Scenario and edge cases Result Evidence
Find which wait in the hook hangs Probe in the hook that logs open sockets with ss -tnp before server.close() File run alone on main server.close() hangs; a host process holds two ESTAB connections to the fake server port probe-7.log, probe-11.log
Confirm the failure on main File run alone, 5 runs Idle host 3 of 5 failed with the 10 s hook timeout before-main-*.log
File passes 10 runs in a row File run alone, 10 runs, then 5 more after rebase on main Same host, prober still running 59 of 59 tests passed in all 15 runs after-*.log, after-rebase.log
Lint, typecheck, PickCheck, secrets oxlint, tsc --noEmit, PickCheck, gitleaks Repo and branch range Clean lint-480-481.log

Evidence paths are under ~/.pickforge/investigations/480/ on the author's machine.

Review:

Round Revision GPT-6.1 Sol
1 a93c2cf 9/10, no findings

… hang close

A local port prober can connect to the fake VNC server while the stalled
connect test waits 2 s, and it keeps its end open. The server only half-closed
its side, so server.close() in afterEach waited forever. Destroy each socket
after the RFB write.

Closes #480
@ElbertePlinio
ElbertePlinio merged commit 6f287cb into main Oct 30, 2026
10 checks passed
@ElbertePlinio
ElbertePlinio deleted the fix/480-viewer-state-stalled-connect branch October 30, 2026 16:27
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.

test(desktop-linux): viewer-state stalled-connect test hangs in afterEach

1 participant