Problem
AClangAstTester builds a per-instance directory name as:
temp-clang-ast-<System.nanoTime()>-<Thread.currentThread().getId()>
This was introduced in 5a9815e688311dfc6abee7ab2f89355be7246581 to stop parallel test instances from sharing copied resources, outputFirst, outputSecond, and cleanup targets.
The isolation requirement is valid, but timestamp plus Java thread ID is a hand-rolled uniqueness scheme. It does not provide the operating system's atomic directory allocation and is weaker across concurrent JVMs or overlapping Gradle runs.
Proposed change
Create one OS-allocated temporary directory per AClangAstTester instance, for example with Files.createTempDirectory("temp-clang-ast-"), and retain that path for the full test lifecycle.
Use that directory for:
- copied input resources;
- the first generated output;
- the second parse/output pass;
- instance-scoped cleanup.
Acceptance criteria
- Two test instances running concurrently never share an input or output directory.
- Separate JVMs and overlapping Gradle invocations receive distinct directories.
- Cleanup deletes only the directory allocated to that test instance.
- Debug or keep-files behavior remains explicit and does not contaminate a later test.
- The test does not depend on the repository working directory.
Problem
AClangAstTesterbuilds a per-instance directory name as:This was introduced in
5a9815e688311dfc6abee7ab2f89355be7246581to stop parallel test instances from sharing copied resources,outputFirst,outputSecond, and cleanup targets.The isolation requirement is valid, but timestamp plus Java thread ID is a hand-rolled uniqueness scheme. It does not provide the operating system's atomic directory allocation and is weaker across concurrent JVMs or overlapping Gradle runs.
Proposed change
Create one OS-allocated temporary directory per
AClangAstTesterinstance, for example withFiles.createTempDirectory("temp-clang-ast-"), and retain that path for the full test lifecycle.Use that directory for:
Acceptance criteria