Use portable timeout helper in test scripts#1909
Open
tianma-if wants to merge 1 commit into
Open
Conversation
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.
Use portable timeout helper in test scripts
Base:
obra/superpowers:devHead:
msh01/superpowers:codex/use-portable-test-timeoutWho is submitting this PR? (required)
What problem are you trying to solve?
On macOS, several Claude/OpenCode test scripts assume the GNU
timeoutcommand exists. In the cleanupstream/devworktree,bash tests/claude-code/test-worktree-native-preference.shfailed immediately with:That prevents the test from reaching its actual Claude Code behavior checks. The same hard dependency appears in the Claude Code test runner, the explicit skill request test harness, and OpenCode integration helpers.
What does this PR change?
Adds
tests/support/with-timeout.sh, a small wrapper that usestimeout,gtimeout, or a Python 3 fallback. Updates the affected test scripts to call that wrapper instead of invokingtimeoutdirectly.Is this change appropriate for the core library?
Yes. This is cross-platform test infrastructure for the core repository and does not add a runtime dependency to Superpowers itself.
What alternatives did you consider?
I considered documenting GNU coreutils as a prerequisite, but these are contributor tests and the repo already uses Python in tests. A tiny local wrapper keeps the scripts usable on macOS without requiring contributors to install extra tools.
Does this PR contain multiple unrelated changes?
No. Every changed file removes the same GNU
timeoutassumption from test scripts.Existing PRs
timeoutin these test scripts. Search also found older unrelated broad test PRs (test: full test coverage for all 16 skills (v5.2.0) #664, fix(hooks): fix Windows hooks for Claude Code 2.1.x #398).Environment tested
New harness support (required if this PR adds a new harness)
Not applicable.
Evaluation
timeout: command not found; after, the timeout wrapper runs and the same Claude test reaches the actual missing-claudeprecondition instead of failing ontimeout.Verification run:
tests/support/with-timeout.sh 2 bash -c 'echo ok' bash tests/shell-lint/test-lint-shell.sh bash tests/opencode/run-tests.sh bash tests/claude-code/test-worktree-native-preference.sh git diff --checkNotes:
bash tests/claude-code/test-worktree-native-preference.shnow fails withERROR: command not found: claudein this environment, which is the real missing CLI precondition. It no longer fails ontimeout.Rigor
timeout: command not foundfailure on cleanupstream/devHuman review