Seen once on main at 3c3e07a, running the full suite (bun run test) on macOS with the
Postgres from docker compose:
agent:test: error: expect(received).toBeLessThanOrEqual(expected)
agent:test: (fail) retireExhausted > retires no more rows than the limit allows
That is apps/agent/test/tasks.integration.spec.ts:183, on
expect((await retireExhausted(2)).length).toBeLessThanOrEqual(2);
I could not reproduce it: 1 failure in 6 runs. The five that passed were three
bun run --filter=agent test --force and two full bun run test --force. The one that
failed was a full-suite run, so apps/api had written its own agentTask rows first.
What I am unsure about, and why I am reporting rather than sending a patch: reading the
SQL in apps/agent/agent/lib/tasks.ts:73, the LIMIT sits inside the subquery, so a
return longer than the limit is not something foreign rows alone seem to explain. Either
the limit can leak under concurrency, or the failure is something else wearing this
test's name.
One thing that does look load-bearing: the test calls claimDue(10, RESEARCH), which
claims up to ten due rows rather than only the three it queued. On a shared database that
is whatever the previous package left behind.
I have no strong opinion on the fix. Happy to dig further if it is useful.
Seen once on
mainat 3c3e07a, running the full suite (bun run test) on macOS with thePostgres from
docker compose:That is
apps/agent/test/tasks.integration.spec.ts:183, onI could not reproduce it: 1 failure in 6 runs. The five that passed were three
bun run --filter=agent test --forceand two fullbun run test --force. The one thatfailed was a full-suite run, so
apps/apihad written its ownagentTaskrows first.What I am unsure about, and why I am reporting rather than sending a patch: reading the
SQL in
apps/agent/agent/lib/tasks.ts:73, theLIMITsits inside the subquery, so areturn longer than the limit is not something foreign rows alone seem to explain. Either
the limit can leak under concurrency, or the failure is something else wearing this
test's name.
One thing that does look load-bearing: the test calls
claimDue(10, RESEARCH), whichclaims up to ten due rows rather than only the three it queued. On a shared database that
is whatever the previous package left behind.
I have no strong opinion on the fix. Happy to dig further if it is useful.