Page MenuHomePhabricator

HTTP request blocked to commons blocked in ForeignAPIRepo::httpGet. Use MockHttpTrait.
Open, Needs TriagePublic

Description

.I.........................................................  5487 / 45469 ( 12%)
..................................................HTTP request blocked: https://commons.wikimedia.org/w/api.php?titles=File%3ATest.png&iiprop=timestamp%7Cuser%7Ccomment%7Curl%7Csize%7Csha1%7Cmetadata%7Cmime%7Cmediatype%7Cextmetadata&prop=imageinfo&iimetadataversion=2&iiextmetadatamultilang=1&format=json&action=query&redirects=true&uselang=en-gb by ForeignAPIRepo::httpGet. Use MockHttpTrait.

More fallout from T262443: Do not hit actual urls during phpunit tests?

Event Timeline

Yeah, I know I need to work out which test this actually is...

And how that just fails isn't helpful either...

Is $wgInstantCommons enabled? That was one of the failures identified in T278003 that had an equally unhelpful error message. The task to deal with that issue is T277470.

Is $wgInstantCommons enabled? That was one of the failures identified in T278003 that had an equally unhelpful error message. The task to deal with that issue is T277470.

It is... But disabling it doesn't help in this case; it still fails at the same point :(

@Reedy what command are you using to run the tests?

@Reedy what command are you using to run the tests?

php tests/phpunit/phpunit.php (same as composer phpunit:entrypoint)

@Reedy what command are you using to run the tests?

php tests/phpunit/phpunit.php (same as composer phpunit:entrypoint)

OK, thanks. We should have a task, if there isn't one already, about having PHPUnit tests pass when run in the way you did (execute everything). We have T297078: PHPUnit tests should pass when run on their own which is more or less the inverse – a bunch of tests fail when run individually. What both scenarios have in common is that our PHPUnit setup is dependent on the way they're currently grouped in CI, which means our tests aren't as robust as assumed, and makes refactoring more difficult.