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 天内回复