For some reason, the DB backend’s AutocompleteTest is failing on MySQL 5.6/5.7. We should figure out, why, and whether this leads to real-world problems, too. (Otherwise, we might want to decide to just not test against those versions – if the fix would complicate the test too much.)

CommentFileSizeAuthor
#7 3091198-7.patch894 bytesalexpott
#7 6-7-interdiff.txt1.6 KBalexpott
#6 3091198-6.patch741 bytesalexpott

Comments

drunken monkey created an issue. See original summary.

drunken monkey’s picture

Component: General code » Tests

It’s now just a single fail, which I can’t reproduce locally: test result.
Does anyone have more luck?

mkalkbrenner’s picture

I just want to mention that we have one single fail in Search API Solr as well which is really strange:

1) Drupal\Tests\search_api_solr_defaults\Functional\IntegrationTest::testInstallAndDefaultSetupWorking
Behat\Mink\Exception\ElementNotFoundException: Button with id|name|label|value "Save" not found.

effulgentsia’s picture

It’s now just a single fail, which I can’t reproduce locally. Does anyone have more luck?

Yes, I can reproduce that Autocomplete test failure locally just by running:

php ./vendor/bin/phpunit -c core ./modules/contrib/search_api/modules/search_api_db/tests/src/Kernel/AutocompleteTest.php

with a MySQL 5.7 database specified for SIMPLETEST_DB within core/phpunit.xml.

It happens on PHP 7.3 too, not just on 7.4.

Per #3126751-5: Fix calls to deprecated PHPUnit methods, it only happens on MySQL 5.6 and 5.7, not 5.5 or 8, and not on other databases.

drunken monkey’s picture

Title: Fix problems on PHP 7.4 » Investigate problems on MySQL 5.6/5.7
Priority: Major » Normal
Issue summary: View changes

Thanks a lot for confirming this and investigating! Then, apparently, we don’t have any problems with PHP 7.4 at all, just with those two MySQL versions. (Further confirmed by this test run.)
Changing the issue title and description accordingly, and decreasing priority.

Unfortunately, I’m not running MySQL at all, just all other supported DBMSs (more or less – MariaDB, SQLite, Postgres), so I can’t reproduce this problem. It would be awesome if someone with the right setup could investigate.
I tried to do it visually, just by looking at the code, but I’m stumped – I don’t see how this would suddenly fail, when the previous assertions don’t. The fact that it only fails on very specific MySQL versions indicates that we trigger some very weird MySQL bug, though, I’d guess? However, don’t really have any further clue.
(I did spot #3133011: Clean up AutocompleteTest::assertSuggestionsEqual(), though.)

alexpott’s picture

Status: Active » Needs review
StatusFileSize
new741 bytes

Here's a patch to prove the problem exists and is not related to PHP 8.1 or Drupal 9.3.x

alexpott’s picture

StatusFileSize
new1.6 KB
new894 bytes

And here's the fix. Not sure why but changing the order of the NOT IT and LIKE conditions fixes this.

alexpott’s picture

I think the reason this is hard to reproduce locally with current MySQL builds is the bug is fixed but DrupalCI is on a very old version on MySQL - ie. 5.7.22

drunken monkey’s picture

Status: Needs review » Fixed

Thanks a lot for digging into this and providing a patch!
Yes, pretty strange that this fixes it, but as long as it’s fixed I’m happy.
Committed. Thanks again!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.