mirror of
https://github.com/alibaba/open-code-review.git
synced 2026-08-23 23:54:55 +00:00
|
Some checks failed
CI / cross-compile (arm64, linux) (push) Has been cancelled
CI / cross-compile (arm64, windows) (push) Has been cancelled
CI / test (push) Has been cancelled
CI / windows (push) Has been cancelled
CI / cross-compile (amd64, darwin) (push) Has been cancelled
CI / cross-compile (amd64, windows) (push) Has been cancelled
CI / cross-compile (arm64, darwin) (push) Has been cancelled
CodeQL Advanced / Analyze (go) (push) Has been cancelled
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (javascript-typescript) (push) Has been cancelled
* fix(scan): join background memory compression before session finalization
* test(scan): exercise background compression join barrier in ScanAgent.Run
- Rewrite TestScanAgent_WaitBackground_NoLeakOnRun using a blocking compression client pattern
- Verify that ScanAgent.Run waits for in-flight memory compression before session finalization
- Assert that memory_compression_task is recorded and session_end is the final record in session JSONL
- Update Runner.WaitBackground doc comment in llmloop/loop.go to reflect scan mode usage
* style: format internal/scan/agent_test.go with gofmt -s
* test(scan): avoid premature cancel exit in blocking compression mock
* fix(test): eliminate race in WaitBackground regression test
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.
---------
Co-authored-by: kite <lizhengfeng.lzf@alibaba-inc.com>
|
||
|---|---|---|
| .. | ||
| agent | ||
| config | ||
| delegate | ||
| diff | ||
| gitcmd | ||
| llm | ||
| llmloop | ||
| mcp | ||
| model | ||
| pathutil | ||
| release | ||
| scan | ||
| session | ||
| stdout | ||
| suggestdiff | ||
| telemetry | ||
| tool | ||
| viewer | ||