Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collect test types in CI in parallel #30450

Merged

Conversation

potiuk
Copy link
Member

@potiuk potiuk commented Apr 4, 2023

One of the steps in our CI is to collect tests, which is to prevent parallel tests from even starting when we know test collection will fail (it is terrible waste of resources to start 20 test jobs and initialize databases etc. when we know it is not needed.

This however introduced a single point of delay in the CI process, which with the recent collection protection implemented in #30315 piled up to more than 5 minutes occassionally on the CI machines of ours, especially on public runners.

This PR utilises our existing test framework to be able to parallelise test collection (Pytest does not have paralllel collection mechanism) - also for localised PRs it will only run test collection for the test types that are going to be executed, which will speed it up quite a lot.

This might get further sped up if we split Provider tests into smaller groups to parallelise them even more.


^ Add meaningful description above

Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

One of the steps in our CI is to collect tests, which is to prevent
parallel tests from even starting when we know test collection will
fail (it is terrible waste of resources to start 20 test jobs and
initialize databases etc. when we know it is not needed.

This however introduced a single point of delay in the CI process,
which with the recent collection protection implemented in apache#30315 piled
up to more than 5 minutes occassionally on the CI machines of ours,
especially on public runners.

This PR utilises our existing test framework to be able to parallelise
test collection (Pytest does not have paralllel collection
mechanism) - also for localised PRs it will only run test collection
for the test types that are going to be executed, which will speed it
up quite a lot.

This might get further sped up if we split Provider tests into
smaller groups to parallelise them even more.
@potiuk
Copy link
Member Author

potiuk commented Apr 4, 2023

We have now 1m 47s insted of 3m 53s -> not bad, 50% less. 2 minutes less waiting.

@potiuk potiuk merged commit 3627eb6 into apache:main Apr 4, 2023
@potiuk potiuk deleted the parallelise-and-speed-up-test-collection branch April 4, 2023 09:37
potiuk added a commit to potiuk/airflow that referenced this pull request Apr 4, 2023
We've added a new reference to test-types in apache#30450 and it clashed
with parameter rename in apache#30424. This resulted in bad merge
(not too dangerous, just causing missing optimisation in collection
elapsed time in case only a subset of test types were to be executed.
potiuk added a commit that referenced this pull request Apr 4, 2023
We've added a new reference to test-types in #30450 and it clashed
with parameter rename in #30424. This resulted in bad merge
(not too dangerous, just causing missing optimisation in collection
elapsed time in case only a subset of test types were to be executed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants