Problem/Motivation
To refresh the update status data, the base class visits the update status page, clicks a link, waits for meta refresh, which then redirects back to the update status page.
We can refresh the data using the API and request the page once it's done.
This test is also probably a candidate for converting to a kernel test, although there's a handful of base classes and traits that all need to be shifted at the same time to do that. This is a small step in that direction because it removes a batch page.
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
Comments
Comment #3
catchComment #4
nicxvan commentedThat looks like a relevant failure unfortunately.
Comment #5
catchNeeds the $ui_only parameter for that method too.
Comment #6
catchWait apparently that's not enough...
Comment #8
quietone commentedJust needed to restore a drupalGet to the ui_only part.
Comment #9
catchFor $ui_only we're often on the page before we call the method, so it might be better to add the drupalGet() before calling the method in just the place that needs it.
Comment #10
catch#8 is right and #9 is wrong, $ui_only visits the check page, so we always need to go back to admin/reports/updates even if we were there before calling the method.
Pushed one commit for UpdateContribTest which appears to need to go via the UI, maybe because it's a newly enabled module. MR is back to green again now.
Comment #11
dcam commentedI found a lingering
drupalGet()that I suspect was made redundant by the #8 changes.Comment #12
catchDropped that one.
Comment #13
dcam commentedThat's the only thing I found. Thank you.
Comment #14
mstrelan commentedI think by fetching via the API without separate drupalGet calls we run in to issues with service properties not being reset in tests that call
refreshUpdateStatusmore than once. In this case,UpdateProcessor::createFetchTaskstores project names in$this->fetchTasks, which is not cleared between calls torefreshUpdateStatus. So from the second call on, nothing is queued andfetchData()does nothing. The tests pass becausedrupalGet('admin/reports/updates')callsgetAvailable(TRUE), which fetches any missing data. I found this with the help of an LLM and verified by stepping through with Xdebug.Comment #15
mstrelan commentedPushed a fix that resets the properties, and verified that subsequent calls now fetch via the API rather than the drupalGet call. It doesn't make the test any faster, but the API path now actually does the fetching.
Comment #16
catchNot sure how we could 'test the test' here, but better to fix it than not. Maybe some of the non-ui/batch things can move to a kernel test later on. I think I can re-RTBC the most recent change even though the rest of this was mostly mine.