#52645 closed task (blessed) (fixed)
Split slow tests into their own job on PHP 5.6 and run them in parallel
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 5.7 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Build/Test Tools | Keywords: | has-patch commit dev-reviewed |
Focuses: | Cc: |
Description
The test suite takes ~16 minutes to run on GitHub Actions, which was recently reduced from ~26 minutes in #52548. The approach taken was to split up the jobs so each one runs faster, and then run them in parallel so the overall duration is reduced.
The PHPUnit tests on PHP 5.6 are the slowest jobs by far, taking ~12 minutes compared to 5 to 7 minutes for all other PHP versions. If we can reduce the time that the PHP 5.6 runs take then we reduce the overall duration.
I propose that for the PHP 5.6 runs specifically, we split the tests in half by selecting the slowest test groups whose combined time is roughly half the time of the whole test run, running them in a separate job, and excluding them from the main job. As the jobs will run in parallel this will reduce the overall duration.
After a bunch of testing I've determined that the external-http
, media
, and restapi
groups combined take roughly the same time as all the other tests combined.
- It's known that the
external-http
tests are slow which is why they are run separately by default - The
media
tests are especially slow on PHP 5.6 - The
restapi
test group contains a large number of tests and therefore consumes a large proportion of the total duration
Running these groups separately reduces the overall duration by around 4 minutes.
Combining this group separation with running the tests from src instead of build means the overall duration dips below 9 minutes.
So, why not do the same for PHP versions other than 5.6? The answer is that for all other PHP versions there is no net gain because the time saved by splitting the tests in half is less than the time taken for the job to be set up and run. Only with PHP 5.6 does the time saving outweigh the time taken to set up the job.
Change History (29)
This ticket was mentioned in PR #1030 on WordPress/wordpress-develop by johnbillion.
4 years ago
#1
- Keywords has-patch added; needs-patch removed
johnbillion commented on PR #1030:
4 years ago
#2
Feedback addressed
#4
@
4 years ago
- Owner set to johnbillion
- Resolution set to fixed
- Status changed from new to closed
In 50444:
#5
@
4 years ago
- Keywords fixed-major added
- Resolution fixed deleted
- Status changed from closed to reopened
johnbillion commented on PR #1030:
4 years ago
#6
#7
@
4 years ago
- Keywords commit dev-reviewed added; fixed-major removed
- Milestone changed from 5.8 to 5.7
Let's include this with the [50441-50442] backports.
https://core.trac.wordpress.org/ticket/52645