Problem/Motivation
PathAliasTest::testPathCache seems to contain a random fail, I've seen it a few times but most recently here
https://git.drupalcode.org/issue/drupal-3426302/-/jobs/4324922
Drupal\Tests\path\Functional\PathAliasTest::testPathCache
Cache entry was created.
Failed asserting that a boolean is not empty.
core/modules/path/tests/src/Functional/PathAliasTest.php:84
Steps to reproduce
?
Proposed resolution
Use key/value instead of state in WaitTerminateTestTrait.
Issue fork drupal-3505952
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
catchRan the test 500 times and 100% pass https://git.drupalcode.org/project/drupal/-/jobs/4330926
Trying another run: https://git.drupalcode.org/project/drupal/-/jobs/4331111
It could be that faillures are more like 1/1000 or 1/5000 or it could be that running only this test concurrently doesn't create the same failure conditions as a normal test job.
The test already uses WaitTerminateTestTrait correctly afaict.
Comment #5
acbramley commented@catch yeah it passed on a rerun on that PR but I've seen it fail more than once. Definitely a rare one but it stood out cause it was a functional test.
Comment #7
mstrelan commentedIn light of #3506148: [meta] Replace all uses of state in tests with direct key value, should WaitTerminateTestTrait be using Key/Value instead of State? Pushing up an MR to see if that passes.
Comment #9
mstrelan commentedSo that makes the performance tests fail because we're doing an extra key/value lookup for every request, in test environments only. Not sure why a get from state is different, maybe it's filtered out by
PerformanceTestTrait::isDatabaseCache? So we have a few options:Comment #10
catchtbh this is how I think it should work in general - it's a lot of extra database queries when taken across the entire test suite.
Comment #11
mstrelan commentedOk I might look in to that option a little more. I also opened #3513875: Move test middleware out of CoreServiceProvider which we can probably use for that.
Comment #12
smustgrave commentedSeems to be pretty inline with the others that were converted from state to key value and those appear to have worked great
Comment #13
mstrelan commentedPostponing on #3513875: Move test middleware out of CoreServiceProvider which, in its current state, should fix this without the need to update performance tests.
Comment #14
catch#3496369: Multiple load path aliases without the preload cache path cache and this test no longer exist.