Install lsof and procps in the sandbox base image - #1121
Merged
Conversation
The dev supervisor finds a port's holder with lsof -ti tcp:<port>. The sandbox image had no lsof, so the port-ownership tests failed, the squatter child was never killed, and test/dev-supervisor-child.test.ts hung the whole npm run test:all inside the factory sandbox. procps adds ps for the same kind of process inspection.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
scripts/dev/lib/proc.tsfinds a port's holder withlsof -ti tcp:<port>. The sandbox base image had nolsof, so inside a factory sandboxtest/dev-supervisor-child.test.tsfailed two port-ownership tests, never killed its TERM-ignoring squatter child, and hungnpm run test:allfor the rest of the run. Reproduced in a native arm64 sandbox container: both concurrent copies of the suite sat on that file for over ten minutes.What
Add
lsofandprocpsto the apt install infly/Dockerfile.procpssuppliesps, which the image also lacked.Proof
Before:
command -v lsofprints nothing in the container, and the file's tests 3 and 5 fail withweb exited during startupandholders.includes(child.proc.pid)false. After the rebuild, the same file passes 5 of 5 in a fresh container from the new image. A fresh loop attempt is running on it.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.