fix(test): resolve CI timing race in TestFakeCmdInfra

问题:TestFakeCmdInfra/integration_with_runCodexTask 在 CI 环境中间歇性失败
原因:WaitDelay(1ms) 与 stdout 事件延迟(1ms) 过于接近,在 CI 负载下
     Wait() 可能在第二个 JSON 事件写入前返回,导致过早关闭 stdout

修复:将 WaitDelay 从 1ms 增加到 5ms,确保 Wait() 在所有 stdout
     数据写入后才返回,消除竞态条件

测试:本地和 -race 模式均通过

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
swe-agent[bot]
2025-12-09 00:34:38 +08:00
parent 1ad2cfe629
commit 18c6c32628

View File

@@ -618,7 +618,7 @@ func TestFakeCmdInfra(t *testing.T) {
Data: `{"type":"item.completed","item":{"type":"agent_message","text":"fake-msg"}}` + "\n",
},
},
WaitDelay: time.Millisecond,
WaitDelay: 5 * time.Millisecond,
})
newCommandRunner = func(ctx context.Context, name string, args ...string) commandRunner {