Skip to content

Clean up test project directories after errors - #103

Open
muneikh wants to merge 1 commit into
leanprover:masterfrom
muneikh:fix-test-project-temp-cleanup
Open

muneikh wants to merge 1 commit into
leanprover:masterfrom
muneikh:fix-test-project-temp-cleanup

Conversation

@muneikh

@muneikh muneikh commented Oct 11, 2026

Copy link
Copy Markdown

The integration test runner chooses a fresh random directory in its error handler instead of cleaning the directory used by the failed project. Setup errors therefore leak the copied project and can remove an unrelated directory with the newly chosen name. Even an invalid test configuration can trigger that unrelated cleanup before any project directory has been created.

Use Lean's IO.FS.withTempDir to allocate each project directory and remove it after either completion or an exception. This also avoids collisions when allocating directories. Add five runner regressions covering setup failures, invalid configuration and child-process exit codes 0 and 7, and run them in CI.

Validation on macOS arm64 with Lean v4.35.0-rc4:

  • The new regressions reproduce three failures with the original runner; all five pass with this change.
  • lake build lean4export comparator succeeds with the exporter revision pinned in lake-manifest.json.
  • All 20 existing integration projects pass with the real nanoda checker and the documented scripts/fake-landrun.sh development shim. This exercises the comparator and kernel checks; Linux sandbox enforcement was not tested.
  • git diff --cached --check passes.

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