From 81bbc14f13a69b22272c7534ec27f0a0d3cfb46a Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Sat, 22 Aug 2026 12:08:00 +0100 Subject: [PATCH] [Testing] Isolate ApplicationFileProcessorTest cache dir to fix parallel flake --- .../ApplicationFileProcessorTest.php | 5 +++++ tests/Application/ApplicationFileProcessor/config.php | 11 +++++++++++ 2 files changed, 16 insertions(+) create mode 100644 tests/Application/ApplicationFileProcessor/config.php diff --git a/tests/Application/ApplicationFileProcessor/ApplicationFileProcessorTest.php b/tests/Application/ApplicationFileProcessor/ApplicationFileProcessorTest.php index 286a9b64ef9..8146993c156 100644 --- a/tests/Application/ApplicationFileProcessor/ApplicationFileProcessorTest.php +++ b/tests/Application/ApplicationFileProcessor/ApplicationFileProcessorTest.php @@ -20,6 +20,11 @@ protected function setUp(): void { parent::setUp(); + // reset the container to boot an isolated cache dir, so parallel test processes cannot + // wipe the shared default cache mid-run and flip the caching assertions below + self::$rectorConfig = null; + $this->bootFromConfigFiles([__DIR__ . '/config.php']); + $this->applicationFileProcessor = $this->make(ApplicationFileProcessor::class); $this->changedFilesDetector = $this->make(ChangedFilesDetector::class); } diff --git a/tests/Application/ApplicationFileProcessor/config.php b/tests/Application/ApplicationFileProcessor/config.php new file mode 100644 index 00000000000..cda9966f616 --- /dev/null +++ b/tests/Application/ApplicationFileProcessor/config.php @@ -0,0 +1,11 @@ +cacheDirectory(sys_get_temp_dir() . '/_rector_application_file_processor_test'); +};