Page MenuHomePhabricator

PHPUnit: Drop enforceTimeLimit command and related settings, because we can't use php-invoker
Closed, ResolvedPublic

Description

… because we can't depend on it in MW core without breaking Windows development. *sighs*

Related Objects

Event Timeline

Does the "You should really fix these slow tests" feature depend on this, or is that a different timeout feature in PHPUnit?

It seems like those reports are still there after https://gerrit.wikimedia.org/r/555752 landed. If not for that, then what is the CI-facing feature we want Quibble to keep offering? Maybe it's something we don't use in CI?

Does the "You should really fix these slow tests" feature depend on this, or is that a different timeout feature in PHPUnit?

No, that comes from phpunit-speedtrap.

If not for that, then what is the CI-facing feature we want Quibble to keep offering? Maybe it's something we don't use in CI?

According to the PHPUnit docs, this feature is used together with @large, @medium, and @small tags, and will make tests fail if they take more than X seconds to execute (depending on the size). Curiously, nothing on codesearch is using those tags, see search.

By looking at git blame, it seems that the option was introduced in r270485 while upgrading to PHPUnit 4 as a replacement for the "strict" option. "strict" was added in d42e3ed23bd553458ef19b4b3c254f46abb87c11, and the relevant quote from the commit message seems to be:

Add E_STRICT reporting to PHPUnit testing.

Chances are, in PHPUnit 3, "strict" served to multiple purposes, including time limits and E_STRICT reporting. It was then split into various options, and we kept them all during the upgrade, but it seems that we never really intended to use time limits.

Note, however, that the feature has been used by our CI for a while, see r4741. According to the commit message, all tests were grouped as "small" by default, but according to the docs I've posted above, this doesn't stand anymore in PHPUnit 8.

Hence, my proposal is to just get rid of the feature altogether.

Hence, my proposal is to just get rid of the feature altogether.

WFM.

Change 566593 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[mediawiki/core@master] phpunit: Drop unused enforceTimeLimit command

https://gerrit.wikimedia.org/r/566593

Change 566593 merged by jenkins-bot:
[mediawiki/core@master] phpunit: Drop unused enforceTimeLimit command and related settings

https://gerrit.wikimedia.org/r/566593

We (Growth-Team) were using php-invoker here, I've submitted a temporary workaround for our tests here. From codesearch it seems like we were the only ones using InvokedRecorder, so i think we'll just rework our code to not depend on it.

Jdforrester-WMF renamed this task from Quibble should inject php-invoker into MediaWiki core's composer dependencies at run time to PHPUnit: Drop enforceTimeLimit command and related settings, because we can't use php-invoker.Jan 23 2020, 4:06 PM
Jdforrester-WMF claimed this task.
Jdforrester-WMF edited projects, added MediaWiki-Core-Tests; removed Quibble.