Problem/Motivation
UncaughtExceptionTest::testLostDatabaseConnection is failing for MariaDB (via PDO)
Drupal\FunctionalTests\Bootstrap\UncaughtExceptionTest::testLostDatabaseConnection
Behat\Mink\Exception\ResponseTextException: The text "DatabaseAccessDeniedException" was not found anywhere in the text of the current page.
Failed 3 times in main in the last 14 days
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
Issue fork drupal-3600845
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
Comment #4
velmir_taky commentedThe assertion is too specific.
testLostDatabaseConnectionsets invalid credentials and expectsDatabaseAccessDeniedExceptionon the page, which the driver only throws for connect error 1045. Any other connection failure throws a different exception, so the string isn't there and the test fails — that's the reported signature, and whycase 'mysql'is currently commented out with a@todopointing here.Same shape as #3521851 (there the real error was
[1524] Plugin 'mysql_native_password' is not loaded).Couldn't reproduce as-is locally (MariaDB via PDO always returns 1045 for bad creds), but forcing a non-access-denied failure reproduces it: a bad host shows
DatabaseConnectionRefusedException+SQLSTATE[HY000] [2002]and the old assert fails withThe text "DatabaseAccessDeniedException" was not found....So instead of pinning one driver exception, assert what the test cares about — the site 500s with the generic kernel panic and the failure is logged. That holds for every driver and code, so I re-enabled
mysqland dropped the @todo. Log anchor isDatabase::openConnection(every driver throws from it) rather than a class name that varies orSQLSTATE(which mysqli isn't).testLostDatabaseConnectionis green on every driver (MariaDB/MySQL PDO, mysqli, PostgreSQL; skipped on SQLite). The red matrix jobs are unrelated and pre-existing —GdToolkit*rotate tests off by 1px and theEmphasisTestJS flake (#2829040) — not this test.Comment #5
smustgrave commentedComment #6
smustgrave commentedAlso since the comment did read like AI I wanted to just lightly mention this https://www.drupal.org/docs/develop/issues/issue-procedures-and-etiquett...
No issue with AI but it does need to be disclosed.
Comment #7
velmir_taky commentedThanks, and fair. I do use AI to help draft my comments and code, noting that here. I run and verify everything locally before pushing. For this one I reproduced the failure and ran the test green on MariaDB and SQLite, plus phpcs. Will disclose going forward.
Comment #8
smustgrave commentedPerfectly fine to do that :)