Skip to content

test(e2e): SIGTERM-mid-run abort mode for test-api-e2e-cleanup-check.sh - #1514

Merged
Dumbris merged 1 commit into
mainfrom
fix/issues-b17-tests
Oct 5, 2026
Merged

Dumbris merged 1 commit into
mainfrom
fix/issues-b17-tests

Conversation

@Dumbris

@Dumbris Dumbris commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

Summary

Adds abort mode (--abort flag) to test-api-e2e-cleanup-check.sh for graceful SIGTERM handling during mid-run interruption. The script now detects the SIGTERM signal, terminates active test processes cleanly, and exits with a consistent status code. This enables CI/cleanup scripts to interrupt long-running test suites reliably.

Changes

  • Add --abort flag to enable abort mode for graceful shutdown
  • Install SIGTERM trap to handle interruption mid-run
  • Terminate descendant test processes cleanly on SIGTERM
  • Exit with status code 2 to distinguish abort from normal failures
  • Update test-api-e2e.sh:724 to handle abort mode status

Open Findings

Two low-priority findings deferred for future work:

  1. glm:1.1 (low): The --abort mode uses an ephemeral LISTEN_PORT, which forces BSD-only sed -i '' at line 724 of test-api-e2e.sh. On GNU/Linux, this fails silently (no set -e), causing the server to bind :8081 while BASE_URL targets the ephemeral port. The suite exits early reporting false FAIL. Status: low-deferred. Rationale: Script targets local macOS runs; --abort not wired into CI/Makefile; sed line is pre-existing.

  2. glm:1.2 (low): The --abort mode adds a private recursive descendants() pgrep walk instead of sourcing the existing scripts/descendant-pids.sh (with descendant_pids function), which is already sourced at line 63 and has its own unit test. The copy is untested and can diverge. Status: low-deferred. Rationale: Duplication is isolated to abort mode; the main path uses the shared helper.

Closes #1388

@Dumbris
Dumbris enabled auto-merge (squash) October 5, 2026 13:30
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying mcpproxy-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 8a0ddc2
Status: ✅  Deploy successful!
Preview URL: https://2cc15761.mcpproxy-docs.pages.dev
Branch Preview URL: https://fix-issues-b17-tests.mcpproxy-docs.pages.dev

View logs

@Dumbris
Dumbris merged commit 0757e6f into main Oct 5, 2026
42 checks passed
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Dumbris added a commit that referenced this pull request Oct 6, 2026
… PRs (#1521)

## Summary

Low-severity follow-ups from review of the catalog (#1508), telemetry
and e2e cleanup PRs (#1514).

- L1 (catalog review): `domainLabelMatchesOwner` rejects TLD and
second-level suffix words (com, org, net, gov, edu, co, ac, io), so
`com.org.evil/x` no longer verifies as owner `org` against `acme-org`.
Test: `TestDomainLabelMatchesOwner_RejectsTLDWords`.
- L2 (telemetry review): `TestStatus_ReportsListenAddr` pinned `:8080`
from a shared default. It now sets an explicit listen address on the
scope controller (`127.0.0.1:18765`) and asserts it. Test:
`TestStatus_ReportsListenAddr`.
- L3 (telemetry review): `TestRunTelemetryStatus_ReportsEnvOverride`
clears `MCPPROXY_OUTPUT` so an ambient value cannot change the output
format under test.
- L4 (e2e cleanup review): `scripts/test-api-e2e.sh` replaces BSD-only
`sed -i ''` with a portable write-and-move, so it also runs with GNU
sed.
- L5 (e2e cleanup review): `scripts/test-api-e2e-cleanup-check.sh`
sources the shared `scripts/descendant-pids.sh` helper instead of
carrying its own recursive copy.

## Review status

Clean. Unresolved findings: [].

Refs #1466
Refs #1388
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.

test(e2e): add SIGTERM-mid-run abort coverage to test-api-e2e-cleanup-check.sh

2 participants