Review 14.3 Merged

95339[BUGFIX] Delete only own scratch directories in unit tests

Stefan Bürk CR +2 V +2 Normal +54 −23 updated 08/26/26, 11:31

Commit message

Unit test cases collect paths in "testFilesToDelete", which the testing
framework removes recursively in tearDown(). A couple of test cases
build a unique directory below a shared root, but register that root:

    $testRoot = Environment::getVarPath() . '/tests/';
    $this->testFilesToDelete[] = $testRoot;
    $path = $testRoot . StringUtility::getUniqueId($prefix);

Such a test case removes the fixture directories of all other test
cases below that root, not only its own. The two roots in question are
"var/tests/" and "public/typo3temp/tests/", used by test cases of
EXT:core, EXT:extensionmanager and EXT:install alike.

This usually stays invisible: test cases run one after another in a
single process, so a removed directory is recreated by the next test
case before anything reads it. It surfaces as soon as test cases run
concurrently, as "tearDown() cleanup: File, link or directory does not
exist" when a test case removes what another one removed already. It
also makes the tear down of a single test case far more destructive
than it looks, which is a trap when adding a test case below one of
those roots.

Register the unique directory a test case creates instead. Where the
shared root is kept in a property, that property gets a unique sub
directory, so the concatenations using it stay untouched.

Registrations of a fixed directory that only a single test case writes
to are left alone: they cannot remove anything of others.
AbstractNodeTest registers only the symlink it creates and not its
target, since the test unlinks that target itself to produce a dead
link.

Review

  • Code review CR +2 Done
    • Stefan Bürk +2
    • Georg Ringer +1
    • Sebastian Fischer +1
  • Verified V +2 Done
    • Stefan Bürk +2
    • Georg Ringer +1
    • core-ci +1 CI

Issues 1

Files 14

Review log 56

  1. Stefan Bürk uploaded patch set 1 08/15/26, 12:05

  2. core-ci voted on patch set 1 V +1 08/15/26, 12:14 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/106760

  3. Sebastian Fischer voted on patch set 1 CR +1 08/24/26, 07:09

  4. Georg Ringer voted on patch set 1 CR +1 V +1 08/26/26, 07:58

  5. Stefan Bürk voted on patch set 1 CR +2 V +2 08/26/26, 11:31

  6. Stefan Bürk merged patch set 2 08/26/26, 11:31