Problem/Motivation

Push pipelines on 8.x-2.x failed on 2026-09-29 while the MR and merge train pipelines of the same commits succeeded, and the failing job changed from run to run.

Steps to reproduce

  • 981251 (af62e8c): phpunit and phpunit (max PHP version) both fail in ControllerTest::testLoggerReportsAccess, with "null is not null". The findOne() on the message the test just logged (ControllerTest.php:457) finds nothing.
  • 981129 (f7874ff): the same assertion fails, in phpunit (previous major) this time.
  • 981222 (17e8545): phpunit (previous minor) crashed with exit code 255, before any test summary.
  • On 2026-09-30, the same ControllerTest assertion failed 4 pipelines of the #3626726: Ensure PHP 8.5 compatibility MR, one different phpunit job each time, the merge train pipeline included.

There are two independent causes:

  • Random log messages: the test logs randomString(32), then looks it up by exact match. When that string contains braces, the logger stores {x} as @x, like core's loggers do through LogMessageParser, even without an x key in the context. The lookup then finds nothing. Whether a run fails depends only on the random string, hence a different job each time.
  • Database not ready: neither the CI templates nor the runner wait for service containers to accept connections, so a slow MySQL start fails the job before any test runs.

Separately, CI installed development branches of dependencies (drush 12.x-dev and 13.x-dev, mongodb/mongodb v2.x-dev and v1.21.x-dev), because composer.json set "minimum-stability": "dev" and "prefer-stable": false. Test results then depended on whatever those branches contained that day.

Proposed resolution

Implemented in the MR, one commit per fix:

  • Random log messages: the module keeps core's behavior, since it is meant as a drop-in replacement for core's logging. ControllerTest derives the stored form of its random message with core's logger.log_message_parser service, and a new LoggerTest::testPlaceholderRewrite pins that rewriting: matched and unmatched placeholders, and nested braces. Literal braces in core log messages are discussed in #2909805: LogMessageParser breaks messages containing braces.
  • Database not ready: every phpunit job waits for its database (MySQL, MariaDB or PostgreSQL) and for MongoDB with wait4x v3.7.2, verifying the downloaded archive against its published checksum.
  • Development branches: minimum-stability and prefer-stable are removed from both composer.json files, so the CI templates' defaults apply.

Remaining tasks

  • Review and merge.

User interface changes

None.

API changes

None.

Data model changes

None.

AI disclosure

This issue and its MR were AI-assisted.

Issue fork mongodb-3626739

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

fgm created an issue. See original summary.

fgm’s picture

Issue summary: View changes

fgm’s picture

Issue summary: View changes
fgm’s picture

  • fgm committed 1c95b48d on 8.x-2.x
    Issue #3626739: Fix test flakiness due to random message strings.
    
    By:...
fgm’s picture

Status: Active » Fixed

Fixed in today's HEAD.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.