Skip to content

test(local-llm): stop betting that pid 777 is dead - #404

Open
plombeer31 wants to merge 1 commit into
mainfrom
fix/download-spawn-test-pid
Open

test(local-llm): stop betting that pid 777 is dead#404
plombeer31 wants to merge 1 commit into
mainfrom
fix/download-spawn-test-pid

Conversation

@plombeer31

Copy link
Copy Markdown
Collaborator

download-spawn > spawns a detached copy of this program with the worker argv failed twice in CI this week, on two unrelated branches (#398 and #403), each time with:

AssertionError: expected { version: 1, …(17) } to match object { pid: 777, status: 'interrupted' }

Both times a re-run of the same commit went green, which is the signature of a bet on the environment rather than a bug in the code under test.

What the test was actually asserting. The fake spawn reported pid 777, and spawnDownloadWorker seeds the record status: "running" with that pid. readDownloadJob reclassifies a running record whose pid is gone as interrupted — so toMatchObject({ pid: 777, status: "interrupted" }) is an assertion that pid 777 does not exist on this machine. On a developer's laptop it does not. On a CI container with a busy pid space it can, and then the record comes back running and the match fails.

The file already defines DEAD_PID = 2_000_000_000 for this exact reason — above the 4,194,304 ceiling Linux will hand out, so nothing can hold it. The fake spawn now reports that, through a named SPAWNED_PID with the reasoning beside it so the next person does not "simplify" it back to a small number.

Test-only change; no production code touched.

`download-spawn > spawns a detached copy…` failed twice in CI this week
on unrelated branches, each time with

  expected { version: 1, …(17) } to match object { pid: 777, status: 'interrupted' }

The fake spawn reported pid 777 and the assertion wanted the seeded
record to read back `interrupted` — which is `readDownloadJob`
reclassifying a `running` record whose pid is gone. So the test was
asserting that pid 777 does not exist. On a laptop it does not; on a
busy CI container it does, and then the record comes back `running`.

The file already had `DEAD_PID` (2,000,000,000) for exactly this, above
the ceiling Linux hands out. The fake spawn now reports that.
plombeer31 added a commit that referenced this pull request Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant