Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
UncaughtExceptionTest is still failing for SQLite and Postgres. Fix it.
Comment | File | Size | Author |
---|---|---|---|
#8 | 6-8-interdiff.txt | 1.05 KB | alexpott |
#8 | 2533946.8.patch | 3.87 KB | alexpott |
#6 | 2533946.6.patch | 3.71 KB | alexpott |
#6 | 1-6-interdiff.txt | 1.49 KB | alexpott |
#1 | 2533946.1.patch | 3.71 KB | alexpott |
Comments
Comment #1
alexpottThe patch attached passes on mysql, postgres and sqlite.
The whole removing exception assertions was bogus because the overridden
error
method was stopping these... we were just removing the assertRaw() assertions... lol.Comment #2
alexpottI've run this test successful on Postgres, SQLite and MySQL - I think we're good to go here.
Comment #3
Fabianx CreditAttribution: Fabianx as a volunteer and at Tag1 Consulting commentedRTBC - Nice catch. Testing the tests and watching the watchers, uhm monkeys is not easy ...
Comment #4
dawehnerDo we mind explaining why sqlite doesn't work?
Comment #5
MixologicNot sure if the pgsql tests are a pgsql issue or if this is fixed for pgsql: https://dispatcher.drupalci.org/job/default/631/testReport/System/Drupal...
Comment #6
alexpott@Mixologic yep that indicates a difference between my Postgres 9.4 and DrupalCI's 9.1. Let's try and make the test not db version dependent.
Comment #8
alexpottre #4/@dawehner sqlite does not use user credentials.
Comment #9
BerdirCan't we just change the path or so? Then it will fail on missing tables or so on the first query, resulting in essentially the same problem. We don't care about the specific error (I think, maybe assertion messages do?) just a scenario where the database is not reachable/broken.
Comment #10
alexpott@Berdir that doesn't work because it breaks the parent site as well.
Comment #11
alexpottOn DrupalCI neither Postgres not SQLite fail due to UncaughtException test. I think this is as good as we can do.
Comment #12
alexpottThe sqlite issue - I'm wrong the parent site is not broken... investigating.
Comment #13
alexpottOkay it is really hard to test this on SQLite - it does not crash at the same point as MySQL and Postgres - they crash in the page cache middleware. Whereas SQLite crashes during routing which means that HttpKernel::handle() eats the exception because $catch is set to TRUE.
I think we should open a separate issue to handle SQLite testing for this.
Comment #14
Berdir+1 to separate issue.
The reason mysql and postgresql already crash early is due to the injected database connection through the cache backend. But I guess the user is logged in then we never actually execute a query there.
This is a problem with the way the weird database service works (it's still a static factory and designed to open the database connection when the object is requested, not when we execute the first query. That's because it's still the 7.x design hidden there which assumes you get the connection because you're going to immediately execute a query. With injection, that's no longer the case.
So I *think* that you could get the same early exception in sqlite if you don't have a logged in user/session and page cache tries to check if there is a cached page.
But again, +1 to separate issue, we can experiment there.
Comment #15
alexpottSo the reason we don't fail at the same place for SQLite is...
in
Cache::getMultiple()
- this is done because there are situations where the table might not exist and then is created on demand.We should definitely handle SQLite in a separate issue. Created #2534818: Support SQLite in UncaughtException::testLostDatabaseConnection
Comment #16
Fabianx CreditAttribution: Fabianx as a volunteer and at Tag1 Consulting commentedLooks good to me :)
Comment #17
catchCommitted/pushed to 8.0.x, thanks!