Files
clawmates/crates/cm-runtime/tests
Omar Sobh 696d8237fe
ci / gates (push) Successful in 7s
ci / frontend (push) Successful in 24s
ci / publish (push) Successful in 2m20s
ci / rust (push) Successful in 3m41s
ci / e2e (push) Failing after 15s
tests(warm_pool): seed a real agent so upsert actually writes the row
Root cause of the "reuse must not drain the pool" flake: the test called
`manager.exec(AgentId::new(), ...)` with a random UUID that had no agents
row. `agent_containers::upsert` uses `INSERT ... FROM agents WHERE a.id = $1`,
which silently inserts zero rows when no agent matches — so the "assigned"
sandbox never persisted to the DB. The next exec's reuse lookup returned
None, fell through to the provision branch, and popped from the warm pool
instead of reusing the assigned sandbox. When the warmer hadn't refilled by
the time we asserted, pool_size == 1 instead of 2.

Seed a workspace + owner + agent up front (mirrors soak.rs's setup). Now
upsert commits a real row, the second exec hits the reuse branch, and the
pool stays whole — the test asserts what its name claims.

The tolerant-health-check change in cm-runtime (15cffba) stays as a
defensive improvement for prod under docker daemon load, but the real fix
for the test is here.
2026-07-05 19:12:13 -07:00
..