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

hashar created this task.Jun 6 2019, 8:41 AM
Restricted Application added a project: Discovery-Search. · View Herald TranscriptJun 6 2019, 8:41 AM
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 claimed this task.Jun 6 2019, 8:44 AM
dcausse triaged this task as Normal priority.
dcausse moved this task from needs triage to Current work on the Discovery-Search board.
dcausse added a subscriber: dcausse.

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.

Ladsgroup added a subscriber: Ladsgroup.

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 ).

debt closed this task as Resolved.Jun 21 2019, 2:19 PM