Speed up ApiQuerySiteinfoTest:testContinuation
authorAntoine Musso <hashar@free.fr>
Fri, 27 Sep 2019 08:42:56 +0000 (10:42 +0200)
committerAntoine Musso <hashar@free.fr>
Fri, 27 Sep 2019 08:42:56 +0000 (10:42 +0200)
commit6d78b45e1bc106f7514e057ecdb5748b8d969d1d
treeb051042f2418b5de1efc5196dda07ec133e6459e
parent0af10d0a1c5a57c8380a5e8201b750894a37a8d4
Speed up ApiQuerySiteinfoTest:testContinuation

The test fills $wgUrlProtocols with 86000 entries, forging oversized
strings which ends up eventually truncated to 100 bytes.  The aim is to
overflow $wgAPIMaxResultSize to trigger an apiwarn-truncatedresult
warning.

The test takes 230 ms on my machine and when generating code coverage
almost a minute.

A faster approach is just to lower the $wgAPIMaxResultSize limit to
trigger the warning.

Test plan:

  $ php tests/phpunit/phpunit.php \
      tests/phpunit/includes/api/ApiQuerySiteinfoTest.php \
      --filter testContinuation

Bug: T234016
Change-Id: I3dc96d394d8b98dda8f151d14544b829c92f9b10
tests/phpunit/includes/api/ApiQuerySiteinfoTest.php