Issue Bug Resolved

#111306DataHandlerCacheFlushTest fails depending on the test order

Georg Ringer 11/01/26, 10:01 updated 11/01/26, 10:25

Description

Problem

The functional test DataHandlerCacheFlushTest::updatedRecordsAreFlushedOnceAtTheEndOfTheDataHandlerRun fails in the pre-merge job “functional postgres 10 php 8.5”: AfterCacheFlushedEvent reports 7 records instead of the 2 expected tt_content records, the first ones being pages 5 and pages 4. The failure is not related to PostgreSQL, it depends on which test class runs before.

Steps to reproduce

  1. Run: ./Build/Scripts/runTests.sh -s functional -d sqlite typo3/sysext/recycler/Tests/Functional/Controller/RecyclerAjaxControllerTest.php typo3/sysext/core/Tests/Functional/Cache/Flush/DataHandlerCacheFlushTest.php
  2. Run DataHandlerCacheFlushTest.php alone: it passes.

Cause

DataHandler::$recordsToClearCacheFor is static and survives between test classes in one PHP process. DeletedRecords::deleteData() calls DataHandler::deleteAction() directly, so processClearCacheQueue() does not run and the queue stays filled. With 10 chunks, RecyclerAjaxControllerTest runs directly before DataHandlerCacheFlushTest, whose DataHandler run then flushes the leftover entries as well.

Proposed fix

Drain the queue in DataHandlerCacheFlushTest::setUp() with an empty DataHandler run, before the page tree fixture is imported and the event listener is registered. Other tests call DataHandler methods such as deleteAction() directly as well, so changing the recycler alone would leave the test dependent on the order.

Reviews 2

History 23

  1. Georg Ringer commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2026-11-01T10:25:14+00:00" > 11/01/26, 10:25 </span>

    Applied in changeset commit:d1f2583f6750bc66e04e894deb89ce9bde49502a.