backdrop / backdrop-issues

Issue tracker for Backdrop core.
144 stars 40 forks source link

Regression: PDO Exceptions when running single tests after #3224 #5202

Closed indigoxela closed 2 years ago

indigoxela commented 3 years ago

Description of the bug

When trying to run a single test (verified with several local and a tugboat instance), it ends up in a fatal error:

ERROR: exception 'PDOException' with message 'SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mydb.simpletest512782semaphore' doesn't exist' in ...core/includes/database/database.inc:2284

Different tables, but it always ends up with "Base table or view not found".

Commenting out line 296 in core/includes/config.inc brings back Simpletest functionality. module_invoke_all('config_create', $config);

Steps To Reproduce

Actual behavior

End up with a PDO Exception

Additional information

That change is pretty new and not released yet. It's in the 1.20 milestone.

https://github.com/backdrop/backdrop/pull/3695

indigoxela commented 3 years ago

Not all tests are affected, but for sure a lot more failures, if the locale module is enabled. Still investigating.

Another finding: running tests with --directory core/modules/whatever also seems broken.

PHP version doesn't seem to matter, I tried with 7.4 and 5.6.

Here's an example error from a tugboat instance, which did not have the locale module enabled:

EXCEPTION: PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'tugboat.simpletest229995cache_bootstrap' doesn't exist: DELETE FROM {cache_bootstrap} WHERE (`cid` = :db_condition_placeholder_0) ; Array ( [:db_condition_placeholder_0] => variables ) in BackdropWebTestCase->refreshVariables() (line 1837 of /var/lib/tugboat/core/modules/simpletest/backdrop_web_test_case.php).
docwilmot commented 3 years ago

docwilmot: I tried running Comment Interface Test on the BackdropCMS.org tugboat demo site, and that also crashed, but the site is running 1.19.3. So maybe this is more than one problem actually.

docwilmot: I didnt get any Exception errors or useful messages, just a test failed and Undefined property: BackdropWebTestCaseCache::$originalLanguageDefault in the logs.

docwilmot: This is with and without locale enabled

klonos commented 3 years ago

@docwilmot the Undefined property: BackdropWebTestCaseCache::$originalLanguageDefault thing should be #4679.

docwilmot commented 3 years ago

OK, so definitely two things, but can you confirm, running that test in the demo, now, leads to an AJAX error. Just curious.

klonos commented 3 years ago

...can you confirm, running that test in the demo, now, leads to an AJAX error.

Confirmed 👍🏼 (separate issue though)

indigoxela commented 3 years ago

Bear with me, wild guessing again...

Maybe the execution of hook_config_create() slows down the table-copy-job of Simpletest? So it might be sort of a race condition somewhere?

hosef commented 3 years ago

Maybe the execution of hook_config_create() slows down the table-copy-job of Simpletest?

I don't think that would affect this. The hooks should only be run on the initial install, which happens before the first test is run.

indigoxela commented 3 years ago

The hooks should only be run on the initial install, which happens before the first test is run.

Hm, are you sure? Many setUp() functions install additional modules - core modules or specific testing modules. To my understanding this happens when setting up the individual test, correct me if I'm wrong.

hosef commented 3 years ago

That is true, but that doesn't happen until after the tables are all copied.

indigoxela commented 3 years ago

Unfortunately this regression breaks i18n tests

Obviously that modules requires locale to be on.

indigoxela commented 3 years ago

Wait, no, false alert. It wasn't this problem causing the failures, but just the recent button text changes. All good, sorry for the noise.

indigoxela commented 2 years ago

Whatever broke, I'm not able to reproduce it anymore. Closing as outdated.