Skip to content

chore: local stop-test-gate hook timeout (exit=143) #123

Closed

Description

@terisuke

Summary

The local stop-test-gate.sh hook consistently exits with code 143 (SIGTERM) when running the full test suite via turbo test. All tests pass but the process is killed before completion due to the hook's timeout.

Behavior

  • Hook detects 52+ source files → triggers full suite fallback
  • turbo test runs all packages (opencode + app + console-app)
  • Tests pass individually but the full suite exceeds the hook's timeout
  • Process receives SIGTERM → exit code 143 (128 + 15)

Fix Options

  1. Increase the hook timeout for turbo test execution
  2. Run only the affected package's tests instead of full suite
  3. Use --filter to scope turbo test to changed packages
  4. Add special handling for exit code 143 (distinguish timeout from real failure)

Impact

  • Non-blocking for development — all tests pass
  • Noise in development workflow

Ref

Observed consistently across all sessions since hook deployment

Activity

  1. terisuke commented on Apr 6, 2026

    @terisuke
    Author

    Related to #129. The stop-test-gate hook timeout (exit=143) is caused by turbo test full suite exceeding the hook's timeout on slower runners. This is a local development issue, not CI-blocking.

    Workaround: Use --filter to scope turbo test to changed packages.
    Proper fix: Tracked in #129 (runner performance).

  2. terisuke commented on Apr 6, 2026

    @terisuke
    Author

    Fixed locally in ~/.claude/hooks/stop-test-gate.sh. Changes:

    1. Exit 143 handling: Added SIGTERM (128+15) to timeout exit code check alongside 124/137
    2. Turbo --filter: Added Phase 1.5 that extracts changed package names from SOURCE_FILES/TEST_FILES and scopes turbo test --filter=<pkg> instead of running full suite
    3. Monorepo timeout: Increased from 60s to 120s when monorepo detected
    4. Cross-cutting threshold: Dynamically raised from 20→40 for monorepos

    Root cause: timeout 60 sends SIGTERM → exit 143, which was not recognized as timeout. Script fell through to exit 2 (block session).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions