Repository navigation
fix(setup): hold doctor probe 3 and 5 outputs in memory and add tests - #1776
Conversation
|
Following up on #1770, this holds command outputs in variables rather than redirecting to Added comprehensive unit test suites for both probes verifying no files are written under Ready for review, @potiuk! |
potiuk
left a comment
There was a problem hiding this comment.
Holding the probe output in memory instead of a file under /tmp is the right fix for the read-only sandbox, and probe 5's change is correct; probe 3's capture needs two adjustments, and its new tests do not reach the line that changed.
Capturing the probe through a pipe makes it wait out the watchdog, and mixes stdout into the error (plugins/magpie-setup/skills/isolated-setup-doctor/scripts/probe-3-container-gateway.sh:104)
out=$(_probe_timeout 15 "$rt" info 2>&1); rc=$?
Two regressions from moving the output into $(…). When neither timeout nor gtimeout is on PATH (stock macOS), _probe_timeout starts (sleep 15 && kill …) &; that sleep inherits the capture pipe, and killing the subshell does not kill it, so $(…) waits the full 15 s even for a healthy runtime (30 s for both). And 2>&1 now captures stdout too: docker info prints its Client: block before failing on the server, so err becomes that first stdout line and the operation not permitted / 502 matches below never fire.
Flagged by both the primary and adversarial reviewers.
Smaller observations
- See inline comments on
plugins/magpie-setup/skills/isolated-setup-doctor/tests/test_probe_3_container_gateway.py:142,plugins/magpie-setup/skills/isolated-setup-doctor/tests/test_probe_5_signing_key.py:39.
This review was drafted by an AI-assisted tool and
confirmed by an Apache Magpie maintainer. The findings
below are observations, not blockers; an Apache Magpie
maintainer — a real person — will take the next look at the
PR. If you think a finding is mis-applied, please reply on
the PR and a maintainer will weigh in.More on how Apache Magpie handles maintainer review:
Contributing guide.
potiuk
left a comment
There was a problem hiding this comment.
Marking this as changes requested, so the PR's status matches where it stands: the points in my earlier review (#1776 (review)) are still open and need a change, or a reply on their threads. This review adds nothing new to them.
This review was drafted by an AI-assisted tool and
confirmed by an Apache Magpie maintainer. After you've
addressed the points above and pushed an update, an Apache Magpie
maintainer — a real person — will take the next look
at the PR. The findings cite the project's review criteria;
if you think one of them is mis-applied, please reply on the
PR and a maintainer will weigh in.More on how Apache Magpie handles maintainer review:
Contributing guide.
886c363 to
37c4307
Compare
…t reachability - Redirect watchdog background sleep to /dev/null to prevent pipe inheritance and 15s hang under command substitution on stock macOS. - Redirect stdout to /dev/null when capturing probe output so docker info stdout does not mask stderr error messages. - Extract shared test runner and POSIX path helpers into helpers.py for probe-3 and probe-5 test suites. - Stub container gateway and bind unix domain socket in test_probe_3 to exercise info probe command, asserting stream separation and zero temp files.
37c4307 to
dff5fd5
Compare
|
Thanks @potiuk for the review and catching both the macOS pipe inheritance and the Docker stdout stream mix-up. Addressed all findings in
|
…al base Review fixup. The shared runner copied the host environment, so the host's CONTAINER_HOST / DOCKER_HOST, or a gateway running on the machine, could reach probe 3 and make the tests host-dependent. It now starts from PATH, HOME, locale and temp variables (plus the Windows essentials) and adds the test's own values. Generated-by: Claude (Opus 5.5)
Summary
${TMPDIR:-/tmp}/...inprobe-3-container-gateway.shandprobe-5-signing-key.sh, matching the sandbox contract documented inisolated-setup-doctor/scripts/README.md.socket.AF_UNIXand add UTF-8 encoding intest_probe_1_ssh_agent.pyto preventAttributeErrorcrashes on platforms without Unix domain socket support.test_probe_3_container_gateway.pyandtest_probe_5_signing_key.py.Type of change
.claude/skills/<name>/) — eval fixtures updated belowtools/<system>/*.md)tools/*/withpyproject.toml)docs/,README.md,CONTRIBUTING.md)projects/_template/)prek, workflows, validators)plugins/magpie-setup/skills/isolated-setup-doctor/)Test plan
prek run/ruff checkandruff format --checkpass on touched files with zero warnings.python -m unittest discover -s plugins/magpie-setup/skills/isolated-setup-doctor/tests/(14 tests run: 14 passed / 3 skipped where AF_UNIX is unsupported).pytest plugins/magpie-setup/skills/isolated-setup-doctor/tests/(11 passed, 3 skipped, 0 failures)./tmpor$TMPDIR.RFC-AI-0004 compliance
<PROJECT>,<tracker>,<upstream>,<security-list>) used in all skill / tool prose (thecheck-placeholdersprek hook is the mechanical gate)Linked issues
Closes #1775
Refs #1770
Notes for reviewers (optional)
Following up on #1770 (which eliminated
/tmpwrites for Probe 1), Probes 3 and 5 still redirected stderr/stdout to files under${TMPDIR:-/tmp}, causing them to abort and report false failures inside read-only sandboxes. This PR brings them into full alignment with the README contract.