mirror of
https://github.com/esengine/DeepSeek-Reasonix.git
synced 2026-11-11 10:01:27 -10:00
Problem: `test (windows-latest)` failed on main-v2 immediately after #10321 with `TestRunExercisesColdOpenAndHistoryIndex` reporting `TempDir RemoveAll cleanup: unlinkat ...\sessions-v4\.recovery-cache\small-capacity\recovery-v1.bolt: The process cannot access the file because it is being used by another process`. The PR leg never ran this package: the Windows job runs a reduced test step on pull requests and `test (full)` on pushes, and only the push step covers tools/. Root cause: run opens a second service for the cold-open phase and deferred only `second.Query().Close()`. Closing the query releases the query cache but not the runtime, so the writer lease and the bbolt recovery store stayed open until process exit. POSIX unlinks open files, so this was invisible off Windows. Fix: release the query cache together with the writer lease and recovery store through one helper. The helper keeps run within the repository function-size limit. Add the testenv lease guard to this package's TestMain so the same leak fails on every platform instead of only in the Windows push leg. Verification: reverting the fix makes the new guard report the leaked `.small-capacity.ownership.lock` and fail the package, and it passes with the fix; go test ./tools/sessioncapacity -count=2, go test -race on the owning and session packages, go test ./... (144 packages), and make lint (golangci-lint 0 issues, repolint clean with no baseline change) all pass.