Skip to content

Write PdfX4Test's profiles and documents to a directory of each test's own - #508

Merged
jakejackson1 merged 1 commit into
gravitypdffrom
fix/pdfx4-test-temp-dir
Sep 26, 2026
Merged

jakejackson1 merged 1 commit into
gravitypdffrom
fix/pdfx4-test-temp-dir

Conversation

@jakejackson1

Copy link
Copy Markdown
Member

PdfX4Test wrote its ICC profiles and output files to fixed names in the system temp directory, and tear_down() deleted every mpdf-test-*.icc there. When two suites ran on one machine at the same time, each deleted the other's profiles partway through a test, causing unlink() and missing-file errors. Several agents working on the open bug PRs hit this. CI doesn't, because each job runs alone.

Each test now makes its own directory under the temp directory (uniqid('', true), as CacheDirectoryRaceTest does) and removes only that directory in tear_down(). The file names are unchanged, because the titles the tests check (mpdf-test-untitled, Quarterly Report, /Info (mpdf-test-cmyk)) are taken from them.

tests/Mpdf/PdfX4Test.php passes (95 tests) and leaves no directory behind. Test-only change.

🤖 Generated with Claude Code

…s own

The test wrote its ICC profiles and output files to fixed names in the system temp directory, and its
tear_down() deleted every mpdf-test-*.icc there. Two runs side by side removed each other's profiles
mid-test and failed with unlink() and missing-file errors. Each test now works in a directory of its
own under the temp directory and removes only that. The file names are kept, as the titles the tests
check are taken from them.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@jakejackson1
jakejackson1 merged commit 1995bf6 into gravitypdf Sep 26, 2026
30 checks passed
@jakejackson1
jakejackson1 deleted the fix/pdfx4-test-temp-dir branch September 30, 2026 01:13
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