mirror of
https://github.com/agent-substrate/substrate.git
synced 2026-10-02 03:24:42 +08:00
## Summary Fixes the flaky test `TestActorLifecycle_WithExternalVolumes` in `cmd/ateapi/internal/controlapi/functionaltest` (`unit` lane). **Root cause:** the test pauses and immediately resumes against a single 1-capacity worker; PauseActor commits the assignment release to the store, but AssignWorker reads the worker cache, which sees the release only after the PostgreSQL watch delivers it — losing that race fails the resume with `ResourceExhausted: no free workers available`. **Fix:** wait for the release to reach the cache with the existing `waitForWorkerAvailable` helper (the same pattern sibling lifecycle tests use after suspend) before resuming. Closes #1533 ## Evidence Flake rate over last 7 days: 5.7% (26 fail / 427 pass across 453 runs) Failures span 14 branches incl. 9 on main; infra-failure runs excluded: 0 Failing runs: https://github.com/agent-substrate/substrate/actions/runs/33919495958, https://github.com/agent-substrate/substrate/actions/runs/33941175484 Passing runs: https://github.com/agent-substrate/substrate/actions/runs/33567474203, https://github.com/agent-substrate/substrate/actions/runs/33566785143 ## Test plan - [x] `go test -race -count=5 ./cmd/ateapi/internal/controlapi/functionaltest/ -run TestActorLifecycle_WithExternalVolumes` — passes (was intermittently failing before at ~6%) Co-authored-by: Aditya Shantanu <aditya-shantanu@users.noreply.github.com>