@sgiehl opened this Issue on April 1st 2018 Member

In most cases the build is currently failing as the system tests for mysqli get terminated after 40min.
For testing purpose I added a small script to check the running times of tests > 5 sec:

https://travis-ci.org/matomo-org/matomo/jobs/360648037

Tests running very long are:

  • Test Piwik\Tests\System\ArchiveCronTest::testArchivePhpCron took 438.5 seconds
  • ​​​​​​​​Test Piwik\Tests\System\ArchiveWebTest::test_WebArchiveScriptCanBeRun_WithPhpCgi_AndWithoutTokenAuth took 466.8 seconds

Setup of the fixture MaySitesImportedLogs only takes ~30 sec, but contains a lot of data. Maybe we should use a smaller fixture for those tests to run faster?

And some of the API tests Piwik\Tests\System\AutoSuggestAPITest::testAnotherApi take alomst 60sec

@sgiehl commented on April 1st 2018 Member

ArchiveWebTest moved to Integration tests for now, so tests are passing again. Nevertheless we should check if we can improve the Archiving tests to run faster...

@mattab commented on June 26th 2018 Member

As found by Phpunit speedtrap in https://github.com/matomo-org/matomo/pull/12763#issuecomment-383531452 the current slowest tests are:

You should really fix these slow tests (>500ms)...
 1. 215204ms to run Piwik\Tests\System\ArchiveCronTest:testArchivePhpCron
 2. 59605ms to run Piwik\Tests\System\TwoVisitorsTwoWebsitesDifferentDaysTest:testApi with data set <a href='/7'>#7</a>
 3. 54062ms to run Piwik\Tests\System\AutoSuggestAPITest:testAnotherApi with data set <a href='/92'>#92</a>
 4. 51416ms to run Piwik\Tests\System\AutoSuggestAPITest:testAnotherApi with data set <a href='/96'>#96</a>
 5. 51372ms to run Piwik\Tests\System\AutoSuggestAPITest:testAnotherApi with data set <a href='/90'>#90</a>
 6. 50215ms to run Piwik\Tests\System\AutoSuggestAPITest:testAnotherApi with data set <a href='/74'>#74</a>
 7. 48881ms to run Piwik\Tests\System\AutoSuggestAPITest:testAnotherApi with data set <a href='/72'>#72</a>
 8. 48671ms to run Piwik\Tests\System\AutoSuggestAPITest:testAnotherApi with data set <a href='/94'>#94</a>
 9. 47777ms to run Piwik\Tests\System\AutoSuggestAPITest:testAnotherApi with data set <a href='/66'>#66</a>
 10. 47513ms to run Piwik\Tests\System\AutoSuggestAPITest:testAnotherApi with data set <a href='/58'>#58</a>
...and there are 202 more above your threshold hidden from view
Time: 32.84 minutes, Memory: 368.00MB
Powered by GitHub Issue Mirror