Closed (fixed)
Project:
Drupal core
Version:
11.x-dev
Component:
base system
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
8 May 2026 at 11:23 UTC
Updated:
23 May 2026 at 06:00 UTC
Jump to comment: Most recent
Comments
Comment #2
longwaveThe failure is here:
I can only assume that the first page load of the functional test is still terminating, which includes running cron, and
AutomatedCron::onTerminate()writes the timestamp exactly between the delete and get?Maybe we should not install
automated_cronvia $modules but manually in the test, then we won't make any accidental HTTP requests that would cause the terminate event to fire? In fact, we might just be able to assert the null instead of setting it first?Comment #3
longwaveAlso took the liberty to fix up the @legacy-covers annotation while we're here.
Comment #5
catchThat looks great to me.
Comment #6
mstrelan commentedI can only assume that the first page load of the functional test is still terminatingWhat is the first http request? I didn't think there were any before this point in the test.
Comment #7
longwave@mstrelan
BrowserTestBase::setup()calls::initMink()which calls::initFrontPage()to visit the homepage so cookies can be set. So I guess if cron is installed already, it runs on the terminate event of this homepage load?Comment #8
longwavePerhaps instead of loading the homepage we could visit a known image URL or similar, which might be slightly more performant in some tests where we don't need to load the homepage at all? Out of scope for here though, unless we want to try that instead of the suggested fix.
Comment #9
longwaveOpened #3589236: Visit an image instead of the homepage in BrowserTestBase::initFrontPage()
Comment #10
mstrelan commentedThanks that makes sense
Comment #13
catchYeah this has to be exactly what's happening. I'd forgotten about the initial front page load for cookies but automated cron will definitely run on the first http request that gets made.
Going to go ahead and commit this even though I RTBCd it because @mstrelan's review ended up a +1. The change here is pretty minimal and we have a follow-up for the trickier bit.