Merge conflict Gerrit cannot merge this change. It needs a rebase onto main.

Review main Work in progress Stale

94945[WIP][TASK] Test testing-framework context leak fix

Stefan Bürk CR 0 V 0 Normal +18 −41 updated 07/25/26, 18:26

Commit message

The testing-framework branch "frontendrequest-context-leak" extends
FrameworkState::push()/pop() to also back up and restore the Context
singleton and the globally registered dependency injection container.
Both are currently left behind by executeFrontendSubRequest(), which
boots a full frontend application and thus leaks frontend request
state into the surrounding test scope.

The branch is the head of the testing-framework pull request

https://github.com/TYPO3/testing-framework/pull/734

which is the source of both the code under test and every update
pulled in here.

Require that branch instead of dev-main to run the core test suites
against it. Besides the composer manifests, the acceptance test setup
script Build/Scripts/setupAcceptanceComposer.sh is adjusted, since it
requires the testing-framework for the freshly created instance, and
the composer example in the Build/Scripts/runTests.sh help output is
kept in sync.

With the state restored by the testing framework, the workaround
added to BlogPostEditingControllerTest by the parent patch becomes
obsolete: resetLeakedFrontendContextWorkaround() and its three call
sites are dropped again, while the explicit DE language aspect and
the database assertions of that patch stay in place.

The review suggestion on the parent patch to use $this->get() instead
of GeneralUtility::makeInstance() for the Context is adopted here and
not there, because it only holds once the container is restored:
without that, makeInstance() resolves through the leaked frontend
container while $this->get() resolves through the container of the
test scope, so both hand out a different Context instance and the
aspect would be set on an object no consumer reads. Verified: the
parent patch with $this->get() fails against dev-main and passes
with the branch required here.

This patch is a test vehicle and must not be merged as it stands.
Once the pull request above has been approved and merged, the branch
usage has to be reverted - composer.json, the dataset_import package
manifest, setupAcceptanceComposer.sh and the runTests.sh help output
back to dev-main - and

composer update typo3/testing-framework

is enough to pick the fix up from main. Only with that in place the
change can be set ready.

Used command(s):

composer require --dev \
    typo3/testing-framework:dev-frontendrequest-context-leak

composer -d Build/tests/packages/dataset_import require \
    typo3/testing-framework:dev-frontendrequest-context-leak \
    --no-update

[1] https://review.typo3.org/c/Packages/TYPO3.CMS/+/94931

Test this change

Run a command in your clone of the TYPO3 Core. Then try what the change does and vote on Verified in Gerrit. How to review a patch

Check out patch set 3
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/45/94945/3 && git checkout FETCH_HEAD
Cherry-pick onto main
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/45/94945/3 && git cherry-pick FETCH_HEAD

Review

  • Code review CR 0 Needs a vote
  • Verified V 0 Needs a vote
    • core-ci +1 CI

Relation chain 2

  1. 94945 [WIP][TASK] Test testing-framework context leak fix This change

  2. main 94931[TASK] Avoid frontend context leak in extbase controller tests This change is based on it Merged Benni Mack CR +2 V +2 Normal +59 −1

    The chain has patch set 4 of 5, the changes above it need a rebase.

Issues 1

Files 6

Review log 37

  1. Stefan Bürk uploaded patch set 1 07/25/26, 17:33

  2. core-ci voted on patch set 1 V +1 07/25/26, 17:41 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/105397

  3. Stefan Bürk uploaded patch set 2 V +1 07/25/26, 17:58

  4. core-ci voted on patch set 2 V +1 07/25/26, 18:06 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/105398

  5. Stefan Bürk updated the commit message in patch set 3 V +1 07/25/26, 18:07

  6. core-ci voted on patch set 3 V +1 07/25/26, 18:14 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/105399

  7. core-ci commented on patch set 3 07/25/26, 18:26 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/105400