mirror of
https://github.com/cexll/myclaude.git
synced 2025-12-24 13:47:58 +08:00
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user