- Issue created by @catch
- First commit to issue fork.
- Merge request !7336Handle the case where a cache item is set in between a cache miss and trying to set → (Open) created by catch
- 🇬🇧United Kingdom catch
I ran WorkflowUiTest 100 times and got 3-4 fails.
https://git.drupalcode.org/project/drupal/-/jobs/1244616
Then with the fix, I ran it 500 times and got 0 fails:
https://git.drupalcode.org/project/drupal/-/jobs/1244933
https://git.drupalcode.org/project/drupal/-/jobs/1248600
https://git.drupalcode.org/project/drupal/-/jobs/1248679
https://git.drupalcode.org/project/drupal/-/jobs/1248737
https://git.drupalcode.org/project/drupal/-/jobs/1248755 - Status changed to Needs review
9 months ago 3:00pm 5 April 2024 - 🇬🇧United Kingdom catch
I need to back out the test changes here, they're just for the repeated test run job so that we only run one test method 100 times instead of the entire test, but would be great to get reviews - and leaving it in for now in case we want to re-run that job even more times.
- Status changed to Needs work
9 months ago 3:28pm 5 April 2024 - 🇬🇧United Kingdom longwave UK
Looks good to me - the fixes make sense and the comments definitely help explain what's going on. As was discussed in Slack this was originally a concern with the cache collector but never was an issue in practice until tests started hitting cold caches occasionally in this way. For me the evidence in #6 is enough to commit this, so NW to remove the test changes.
- Status changed to Needs review
9 months ago 4:21pm 5 April 2024 - 🇬🇧United Kingdom catch
Yeah we covered the warm (but invalid) cache situation with the cache collector, which is the main case, but cold + invalid just never came up or seemed realistic. Additionally you would never hit this with a discovery cache (which is most cache collector use cases), because it's unlikely to get invalidated twice in the same request or anything, needs to be extremely high write. I'm not sure a site would even run into this with state because fully cold cache then immediate write situation seems unlikely there too, but we're clearly hitting it in tests.
Rebased to drop the test modifications.
- Status changed to RTBC
9 months ago 4:37pm 5 April 2024 - 🇬🇧United Kingdom catch
Had one more look over this and realised the comment in State::set() was slightly out of date and could be clearer. Updated that but leaving RTBC since it's comment-only.
- 🇬🇧United Kingdom alexpott 🇪🇺🌍
alexpott → changed the visibility of the branch 3438424-random-test-failures to hidden.
- 🇬🇧United Kingdom alexpott 🇪🇺🌍
alexpott → changed the visibility of the branch 3438424-usleep to hidden.
- Status changed to Needs work
9 months ago 12:01pm 6 April 2024 - 🇬🇧United Kingdom alexpott 🇪🇺🌍
The latest changes have the MR failing tests... see https://git.drupalcode.org/project/drupal/-/merge_requests/7336/pipelines
- Status changed to RTBC
9 months ago 2:45pm 6 April 2024 - 🇬🇧United Kingdom catch
Managed to commit to the wrong branch... dropped from the MR now.
- Status changed to Needs work
9 months ago 3:10pm 6 April 2024 - 🇬🇧United Kingdom alexpott 🇪🇺🌍
Still failing tests...
core/tests/Drupal/Tests/Core/Cache/CacheCollectorTest.php
core/profiles/standard/tests/src/FunctionalJavascript/StandardPerformanceTest.phpI think having the MR link in the issue messes up d.o so it puts the failing test link in the wrong place... I've removed that from the issue summary so hopefully this is easier to see.
- 🇬🇧United Kingdom catch
OK now I can see the test failures, that's helpful.
The unit test failure is very handy, I wasn't sure how to test the race condition here, but turns out we already had a unit test for a cache item being set in the middle of the request. I've split that one method into two, so it now tests both the warm cache situation (already covered but the test wasn't explicitly testing this) and cold cache situation (what we're fixing here and what the test coverage was actually testing but with different expectations).
- Status changed to Needs review
9 months ago 10:17am 7 April 2024 - 🇬🇧United Kingdom catch
Performance tests are green now - it's one extra state cache set + the related key/value queries collected during that request, not surprising since we're being more conservative about writing to the cache on completely cold starts now.
- Status changed to RTBC
8 months ago 2:16pm 9 April 2024 - 🇬🇧United Kingdom alexpott 🇪🇺🌍
Given catch's changes are to a test to fix and improved comments going to rtbc and commit. Hopefully this will reduce some of the random fails due to the state cache collector from occurring.
- 🇬🇧United Kingdom alexpott 🇪🇺🌍
-
alexpott →
committed af46c48e on 10.3.x
Issue #3438424 by catch, Berdir, alexpott, longwave: [random test...
-
alexpott →
committed af46c48e on 10.3.x
- Status changed to Fixed
8 months ago 5:01pm 9 April 2024 -
alexpott →
committed 3a3e6186 on 11.x
Issue #3438424 by catch, Berdir, alexpott, longwave: [random test...
-
alexpott →
committed 3a3e6186 on 11.x
Automatically closed - issue fixed for 2 weeks with no activity.