mirror of
https://github.com/alibaba/open-code-review.git
synced 2026-08-25 00:25:24 +00:00
The original test had two timing bugs that made it pass even when
WaitBackground() was removed:
1. The mock's round-2 response (task_done) could return before the
background compression goroutine reached the mock, allowing Run to
finish before 'started' was ever closed. Fix: round 2 now waits on
<-c.started so the main loop cannot complete until compression is
in-flight.
2. The 'select { default: }' check fires instantly — if Run hadn't
returned YET (still in cleanup, not because WaitBackground held it),
the test passed spuriously. Fix: use time.After(200ms) which is
vastly longer than the sub-millisecond cleanup path, so Run will
have returned if WaitBackground is missing.
Verified: test now correctly FAILs when WaitBackground is commented out
and PASSes when it is present.
|
||
|---|---|---|
| .. | ||
| agent | ||
| config | ||
| delegate | ||
| diff | ||
| gitcmd | ||
| llm | ||
| llmloop | ||
| mcp | ||
| model | ||
| pathutil | ||
| release | ||
| scan | ||
| session | ||
| stdout | ||
| suggestdiff | ||
| telemetry | ||
| tool | ||
| viewer | ||