Flake: a_refused_connection_is_not_retried races other tests for its freed port
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
研究方向
從 crates/socket-patch-core/tests/api_retry_e2e.rs 開始,特別查看 a_refused_connection_is_not_retried 和 issue 中描述的 listener 設定。檢查測試如何在斷言期間保持一個已繫結但未監聽的 socket,然後執行這個整合測試。完成條件是該連接埠對平行測試仍不可用,而且斷言仍要求 ApiError::Network。
由索引模型根據 Issue 內容生成。
描述
[agent] Found while handling a merge-queue eviction of #2405 (a test-only change in the CLI crate that does not touch this code).
Problem
a_refused_connection_is_not_retried in crates/socket-patch-core/tests/api_retry_e2e.rs picks its "dead" port by binding 127.0.0.1:0, reading the port and dropping the listener. Tokio tests in the same binary run in parallel and start their own stand-in servers on 127.0.0.1:0, so one of them can be handed the port just freed. The request then reaches a live server instead of being refused.
Evidence
Merge-queue CI run 46744428179, job coverage (1):
thread 'a_refused_connection_is_not_retried' panicked at crates/socket-patch-core/tests/api_retry_e2e.rs:983:5:
Other("API request failed with status 404: 127.0.0.1:36553 did not answer like the Socket patch API — check --api-url / SOCKET_API_URL and the organization slug 'org' (--org / SOCKET_ORG_SLUG)")
test result: FAILED. 17 passed; 1 failed
Something answered 404 on the port the test expected to be closed. ci-ok failed on that job alone and the queue entry was evicted.
Suggested fix
Keep the port reserved and still refusing for the length of the test, so no other test can take it. One way: bind a socket to the port without calling listen and hold it until the assertions finish (a connect to a bound, non-listening TCP socket is refused on Linux, macOS and Windows). Don't loosen the assertion on ApiError::Network.
Generated by Claude Code
- 主要語言
- Rust
- 星號
- 9
- 分支
- 2
- 平均合併
- 1 天 2 小時
- 30 天內合併 PR
- 213
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
SocketDev/socket-patch 的其他 Issue
-
agent:triaged arch-audit bug priority:p1
難度 2/5 1-3 小時 新手友好度 76/100
SocketDev/socket-patch#2517 ·
維護者通常 1 天內回覆
-
agent:triaged bug bughunt pm:bundler priority:p1 ux
難度 2/5 1-3 小時 新手友好度 76/100
SocketDev/socket-patch#2508 ·
維護者通常 1 天內回覆
-
agent:triaged bug bughunt pm:npm priority:p1
難度 2/5 1-3 小時 新手友好度 78/100
SocketDev/socket-patch#2476 ·
維護者通常 1 天內回覆
-
agent:triaged arch-audit priority:p3 refactor
難度 2/5 1-3 小時 新手友好度 78/100
SocketDev/socket-patch#2429 · 1 則留言 ·
維護者通常 1 天內回覆
-
agent:triaged arch-audit priority:p3 refactor
難度 2/5 1-3 小時 新手友好度 76/100
SocketDev/socket-patch#2419 ·
維護者通常 1 天內回覆
查看 SocketDev/socket-patch 的全部 Issue
相似的 Issue
-
chat compiler P1
難度 2/5 1-3 小時 新手友好度 76/100
HerringtonDarkholme/hd-lang#2793 ·
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆
-
security-advisory
難度 2/5 1-3 小時 新手友好度 78/100
MinBZK/regelrecht#2173 ·
-
ci
難度 2/5 1-3 小時 新手友好度 88/100
jonathanong/no-mistakes#5804 ·
-
triage: failed
難度 2/5 1-3 小時 新手友好度 68/100
oxc-project/tsrs#1277 · 1 則留言 ·
維護者通常 1 天內回覆