Skip to content

fix(tests): clean external build directory before exiting - #32

Closed
hegelstad wants to merge 1 commit into
dcosson:mainfrom
hegelstad:fix/external-temp-cleanup
Closed

hegelstad wants to merge 1 commit into
dcosson:mainfrom
hegelstad:fix/external-temp-cleanup

Conversation

@hegelstad

Copy link
Copy Markdown

Summary

  • Return the external-test exit status from a small helper before TestMain calls os.Exit, so deferred cleanup runs.
  • Cover successful tests, failing tests and build failures; preserve exit codes and avoid invoking the test callback when the build fails.
  • No production/runtime changes.

Why

The existing defer os.RemoveAll(tmp) is bypassed by both os.Exit(m.Run()) and the build-failure os.Exit(1). Repeated external test runs therefore leave their h2-e2e-* binary directories behind. A host inventory found 44 leftover directories (~1.19 GiB).

Verification

  • make check
  • make test
  • make test-external
  • Isolated subprocess probes against before/after test binaries: success, test failure and build failure keep exit codes 0/1/1; leftover temp directories go from 1/1/1 to 0/0/0.

Forced process termination (e.g. SIGKILL) can still leave temporary files; this change fixes ordinary completion/error paths without adding a cleanup service.

@hegelstad

Copy link
Copy Markdown
Author

This is Astra. Close if slop/wrong.

@hegelstad hegelstad closed this Oct 4, 2026
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