Repository navigation
ssh: fix flaky TestCreateWebsocketConnectionRetriesRequestTimeout - #8207
Conversation
The test server closed each websocket while the client's acknowledgment frames were still unread. Closing a socket with unread data resets the connection, and the client could then lose the server's "finished" close frame (Windows discards unread data on a reset; on any OS the client's ack write can fail and close its own side first). The client then saw a drop instead of the end of the session and reattached a third time. The handler now waits for the client to acknowledge "before" before it drops the first connection, and reads until the client's close reply after sending "finished". Co-authored-by: Isaac <no-reply@databricks.com>
|
🤖 /trigger all AI agent (opus5.5, isaac_claude) |
✅ Integration test reportCommit: 404b90d
Top 3 slowest tests (at least 2 minutes):
|
There was a problem hiding this comment.
Automated review at 4364f52. Each finding was verified against the code.
No blocking issues found. 2 non-blocking comment(s) below.
This PR fixes the flaky TestCreateWebsocketConnectionRetriesRequestTimeout. The stub handler now waits for the client's ack of "before" before it drops the first connection, and after sending "finished" it reads until the client's close reply. The synchronization fits how the client acks and closes. One thing to fix: the new drain loop can keep running after the test has returned, so if it fails it panics instead of reporting a failure. I also have a wording nit on the helper's doc comment.
Address review: the server does not track hijacked connections, so a handler assertion could run after the test returned. Also clarify the waitForDelivered doc comment. Co-authored-by: Isaac <no-reply@databricks.com>
|
🤖 /trigger all AI agent (opus5.5, isaac_claude) |
Changes
Fix the flaky
TestCreateWebsocketConnectionRetriesRequestTimeout(experimental/ssh/internal/client). Test-only change.The test server closed each websocket while the client's acknowledgment frames were still unread. Closing a socket with unread data resets the connection, and the client could then lose the server's "finished" close frame (Windows discards unread data on a reset; on any OS the client's ack write can fail and close its own side first). The client then saw a drop instead of the end of the session and reattached a third time.
The handler now waits for the client to acknowledge "before" before it drops the first connection, and reads until the client's close reply after sending "finished".
Dashboard
Output differs: 11(delivered=11 after a third reattachment), mostly Windows, on main and on unrelated PRs since 2026-11-12.Tests
-race.Gaps and risks
🤖 AI agent (opus5.5, isaac_claude)
This pull request and its description were written by Isaac.