Skip to content

Use portable timeout helper in test scripts#1909

Open
tianma-if wants to merge 1 commit into
obra:devfrom
tianma-if:codex/use-portable-test-timeout
Open

Use portable timeout helper in test scripts#1909
tianma-if wants to merge 1 commit into
obra:devfrom
tianma-if:codex/use-portable-test-timeout

Conversation

@tianma-if

Copy link
Copy Markdown

Use portable timeout helper in test scripts

Base: obra/superpowers:dev
Head: msh01/superpowers:codex/use-portable-test-timeout

Who is submitting this PR? (required)

Field Value
Your model + version GPT-5
Harness + version Codex desktop app (exact app version not exposed in this session)
All plugins installed Codex app tools exposed in this session, including GitHub, OpenAI bundled browser/chrome/computer-use, OpenAI primary runtime document/pdf/spreadsheet/presentation/template tools, Cloudflare, HeyGen, Hugging Face, Neon Postgres, Notion, Vercel, and local custom HyperFrames/media skills
Human partner who reviewed this diff msh01

What problem are you trying to solve?

On macOS, several Claude/OpenCode test scripts assume the GNU timeout command exists. In the clean upstream/dev worktree, bash tests/claude-code/test-worktree-native-preference.sh failed immediately with:

tests/claude-code/test-helpers.sh: line 19: timeout: command not found

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 uses timeout, gtimeout, or a Python 3 fallback. Updates the affected test scripts to call that wrapper instead of invoking timeout directly.

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 timeout assumption from test scripts.

Existing PRs

Environment tested

Harness Harness version Model Model version/ID
Codex desktop app exact app version not exposed GPT-5 GPT-5

New harness support (required if this PR adds a new harness)

Not applicable.

Evaluation

  • Initial prompt: user asked to find real, high-quality contribution candidates for Superpowers.
  • Eval sessions run after the change: 0; this is test harness portability, not skill behavior.
  • Before/after: before, macOS test execution stopped at timeout: command not found; after, the timeout wrapper runs and the same Claude test reaches the actual missing-claude precondition instead of failing on timeout.

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 --check

Notes:

  • bash tests/claude-code/test-worktree-native-preference.sh now fails with ERROR: command not found: claude in this environment, which is the real missing CLI precondition. It no longer fails on timeout.

Rigor

  • Reproduced the macOS timeout: command not found failure on clean upstream/dev
  • Verified the new wrapper path reaches the actual test command
  • No skill behavior changed

Human review

  • A human has reviewed the COMPLETE proposed diff before submission

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