Skip to content

test(launchx): fix the flaky open-tab test - #20

Merged
sergiudm merged 1 commit into
mainfrom
fix/launchx-tab-test-flake
Nov 17, 2026
Merged

sergiudm merged 1 commit into
mainfrom
fix/launchx-tab-test-flake

Conversation

@sergiudm

Copy link
Copy Markdown
Collaborator

What

launchx::tests::an_open_tab_is_found_through_the_run_file (from #18) failed most runs of the full Rust suite.

Cause: its stand-in server read the request with one read(), answered, and closed. The client may send the headers and the {} body in separate writes. Closing with the body still unread made the kernel reset the connection, so the client got the 200 status line and then "Peer disconnected" while reading the body, and focus_open_tab returned false. It showed up only under load, so the test passed when run alone.

Fix: the stand-in now reads the headers and the Content-Length body before it answers, like one_shot_server in commands/browser.rs. Only the test changes; focus_open_tab is unchanged.

This was pushed to #19 after that PR had already merged, so it never reached main.

Testing

  • Before: the full suite failed 6 of 8 runs locally, always on this test.
  • After: 10 of 10 runs passed on the old branch, and 5 of 5 on this branch (on top of current main), plus the golden suite.

🤖 Generated with Claude Code

an_open_tab_is_found_through_the_run_file failed most runs of the full
suite. Its stand-in server read the request with one read(), answered, and
closed. The client may send the headers and the {} body in separate writes;
closing with the body unread made the kernel reset the connection, so the
client got the 200 status line and then "Peer disconnected" reading the
body, and focus_open_tab returned false. It showed only under load.

The stand-in now reads the headers and the Content-Length body before it
answers, like one_shot_server in commands/browser.rs. The code under test is
unchanged. The full suite passed 10 of 10 runs (it failed 6 of 8 before).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sergiudm
sergiudm merged commit 6c584be into main Nov 17, 2026
3 checks passed
@sergiudm
sergiudm deleted the fix/launchx-tab-test-flake branch November 17, 2026 02:18
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