Page MenuHomePhabricator

CirrusSearch\SearcherTest::testSearchText PHPUnit tests take a while and runs for everyone
Closed, ResolvedPublic

Description

CirrusSearch is an important extension and it is part of the set of repositories tested together which is nice. However, one of its PHPUnit test suite takes a while (1 min 30 - 2 mins) and since it is run for any repository that depends on CirrusSearch, that slightly slow down changes processing in CI.

From T221434 the identified PHPUnit suite is CirrusSearch\SearcherTest::testSearchText

It should show up on the test report https://integration.wikimedia.org/ci/job/wmf-quibble-core-vendor-mysql-hhvm-docker/lastCompletedBuild/testReport/(root)/ and sorting by duration.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

If there are ways to easily speed it up, that would be very appreciated.

Eventually we might flag that specific test suite to only run it when a change is for CirrusSearch. We have a similar issue with a Scribunto test suite. The idea is being discussed on T225068

dcausse triaged this task as Medium priority.
dcausse moved this task from needs triage to Current work on the Discovery-Search board.
dcausse subscribed.

we blindly copied all browser tests fixtures and run them on 3 different setup, I'm sure we can prune down the list of tested cases.

Change 514677 had a related patch set uploaded (by DCausse; owner: DCausse):
[mediawiki/extensions/CirrusSearch@master] Randomize searcherText cases and limit them to 200 by default

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

I finally opted for a randomized approach where I limit the number of fixture at 200 by default per run. The fixtures to test are selected randomly. If merged the full suite of unit tests for Cirrus would now take 25sec instead of 1m30 on my laptop.

Change 514677 merged by jenkins-bot:
[mediawiki/extensions/CirrusSearch@master] Randomize searcherText cases and limit them to 200 by default

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

Thank you @dcausse :] Discovery covered its part. The second part is to only run this test when CI is triggered by CirrusSearch, the latest idea is to flag it with @group standalone and we instrument that in CI to skip the test ( T225068#5247536 ).

Change 587883 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[mediawiki/extensions/CirrusSearch@master] [DNM] Only run the SearcherTests for this repo, not the gate

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

Change 587883 merged by jenkins-bot:
[mediawiki/extensions/CirrusSearch@master] Only run certain big, isolated tests in this repo, not in gate

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