Last modified: 2012-05-17 21:35:06 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T36037, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 34037 - make unit test work with PHPUnit invoker
make unit test work with PHPUnit invoker
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Unit tests (Other open bugs)
1.20.x
All All
: Normal minor (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-01-30 13:03 UTC by Antoine "hashar" Musso (WMF)
Modified: 2012-05-17 21:35 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Antoine "hashar" Musso (WMF) 2012-01-30 13:03:05 UTC
bug 33663 showed that our test suite does not play well when PHP_Invoker is installed. It is an utility class for invoking PHP callables with a timeout and is used by PHPUnit whenever it is installed.

From https://bugzilla.wikimedia.org/show_bug.cgi?id=33663#18 :

--------8<----------------8<-----------------8<---------

The timeout messages comes from PHPUnit. It is most probably caused because
PHP_Invoker is installed ( https://github.com/sebastianbergmann/php-invoker  )
which make PHPUnit think our tests are small and should run in less than a
second.

By looking at the code of PHPUnit, this behavior only happens while in strict
mode (by looking at PHPUnit/Framework/TestResult.php. Can you try editing
MediaWiki file "tests/phpunit/suite.xml", in the very first few lines you
should have something looking like:
 strict="true"

replace it by:
  strict="false"

That should disable strict node and the whole timeout system. If that solve the
issue, we would have to find a way to disable that system entirely.

--------8<----------------8<-----------------8<---------
Comment 1 christian 2012-04-06 21:27:35 UTC
(In reply to comment #0)
> PHPUnit think our tests are small and should run in less than a
> second.

Yes.
PHPUnit knows three test sizes:
* small (this is the default test size), defaults to: <= 1 second
* medium, defaults to: <= 10 second
* large, defaults to: <= 60 second

Adding an „@group medium” or „@group large” to the test functions gives the test more execution time.

See TextPassDumperTest::testCheckpointPlain() in
https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/core.git;a=blob;f=tests/phpunit/maintenance/backupTextPassTest.php;h=5882cc02611a2649c2aa2fc02802dfb99cfde497;hb=da58f7f55cf588aaffd55b3f601f521514d0166f#l394
Comment 2 Antoine "hashar" Musso (WMF) 2012-04-11 19:09:29 UTC
Raising the timeout to 2 seconds should do it.

Patch submitted: https://gerrit.wikimedia.org/r/4741
Comment 3 Antoine "hashar" Musso (WMF) 2012-04-11 19:20:38 UTC
For REL1_19 : https://gerrit.wikimedia.org/r/#change,4742
Comment 4 Antoine "hashar" Musso (WMF) 2012-05-17 21:35:06 UTC
Looks like this issue has been solved overtime. The main one was parser tests triggering a l10n recache which took a long time. Parsertests are now in group medium, aka with a 10 sec timeout.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links