Skip to content

fix(test-run-with-timeout-signals): use SCRIPT_DIR instead of cwd-relative path#87

Open
kitsuyui wants to merge 1 commit into
mainfrom
fix/audit-test-timeout-signals-cwd-assumption-001
Open

fix(test-run-with-timeout-signals): use SCRIPT_DIR instead of cwd-relative path#87
kitsuyui wants to merge 1 commit into
mainfrom
fix/audit-test-timeout-signals-cwd-assumption-001

Conversation

@kitsuyui

Copy link
Copy Markdown
Member

Summary

test-run-with-timeout-signals.sh called scripts/run-with-timeout.sh as a
path relative to the working directory. When the script is invoked from any
directory other than the repo root the lookup fails with "No such file or
directory", masking the actual signal-propagation test result.

Changes

  • Add SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" after set -euo pipefail
  • Replace the cwd-relative scripts/run-with-timeout.sh invocation with
    "${SCRIPT_DIR}/run-with-timeout.sh"

The test now finds run-with-timeout.sh regardless of the caller's working
directory, matching the robustness expected of a self-contained test script.

Testing

No functional change to the test logic. Verified with shellcheck (clean) and
shfmt -d (no format drift). The CI timeout-helper job already runs from
repo root and continues to work; the fix additionally handles non-root cwd
scenarios.

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