Conversation
…its command through a shell (danielmiessler#2188) The grader shelled out to `timeout`, which is GNU coreutils and absent on a stock macOS install, so every test file came back `bun: command not found: timeout` and was graded failed — 0/N on a suite that passes. The same line interpolated `${command}` into a tagged template, which escapes a multi-word test command into a single argv token. Spawn `/bin/sh -c` (`cmd /c` on win32) with Bun's own `timeout`/`killSignal` instead. The pipe drain is capped, because a killed shell can leave an orphan child holding stdout open: awaiting it outright made the timeout worthless (measured 30s on a 1.5s budget). Verified on macOS: passing file -> 1/1 (was 0/1), failing file -> 0/1, `sleep 30` with timeout_ms 1500 -> 0/1 in 3.5s (was 30s). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PuS77R8a6Lhp7jK6dnwdTh
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.
Fixes #2188.
Two defects in one line. The grader shelled out to
timeout, which is GNU coreutils and absent on a stock macOS install, so every test file came backbun: command not found: timeoutand was graded failed (0/N on a suite that passes). The same line interpolated${command}into a tagged template, which escapes a multi-word test command into a single argv token.This spawns
/bin/sh -c(cmd /con win32) with Bun's owntimeout/killSignalinstead of the external binary.One non-obvious detail: the pipe drain is capped rather than awaited outright. A killed shell can leave an orphan child holding stdout open, and awaiting
new Response(proc.stdout).text()in that state made the timeout worthless, measured at 30s on a 1.5s budget.Verified on macOS:
sleep 30, timeout_ms 1500🤖 Generated with Claude Code
https://claude.ai/code/session_01PuS77R8a6Lhp7jK6dnwdTh