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

(Try to) improve CI build reliability #3703

Merged
merged 3 commits into from
May 6, 2021
Merged

(Try to) improve CI build reliability #3703

merged 3 commits into from
May 6, 2021

Conversation

3flex
Copy link
Member

@3flex 3flex commented Apr 26, 2021

These changes should all help, or at least not make things any worse, by:

  • reducing work done (by dropping one of the multi-Gradle version tests)
  • reducing memory use (by not allocation 2GB heap for each Gradle integration test - 512MB is the default, and unless there are OOM errors there shouldn't be any need to increase this)
  • reducing CPU contention during heavy load during the build (by reducing max worker count from 4 to # of CPUs, which is 2 on Windows & Linux CI runners and 3 on macOS)

@3flex
Copy link
Member Author

3flex commented Apr 28, 2021

I think we should hold off merging because it doesn't actually make the build more reliable, since it's still failing on the Gradle plugin merge reports test.

#3705 (comment)

Or I can skip the tests on Java 11 for now... At least then the build will hopefully stay green, but it's just hiding the problem. I can't reproduce locally though so I don't know how to resolve.

@cortinico
Copy link
Member

Or I can skip the tests on Java 11 for now... At least then the build will hopefully stay green, but it's just hiding the problem. I can't reproduce locally though so I don't know how to resolve.

Can we split it in smaller chunks? E.g. the GH Actions Cache fix could go alone imho

@3flex 3flex force-pushed the build-perf branch 2 times, most recently from 7304e1b to 26943d7 Compare May 6, 2021 01:24
3flex added 3 commits May 6, 2021 11:25
All other tests are run on the current Gradle wrapper version, so there's
no need to also test a recent version in this test.
There are only 2 CPUs on Linux & Windows CI hosts, 3 on macOS, and
unknown on contributor's machines. Let Gradle pick an appropriate
default.
@codecov
Copy link

codecov bot commented May 6, 2021

Codecov Report

Merging #3703 (83d59a3) into main (4ee28ac) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##               main    #3703   +/-   ##
=========================================
  Coverage     78.67%   78.67%           
  Complexity     2888     2888           
=========================================
  Files           473      473           
  Lines          9309     9309           
  Branches       1704     1704           
=========================================
  Hits           7324     7324           
  Misses         1080     1080           
  Partials        905      905           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4ee28ac...83d59a3. Read the comment docs.

@3flex
Copy link
Member Author

3flex commented May 6, 2021

There doesn't seem to be a direct link between the memory usage and the specific test failure that kept coming up with this change, but it seems to consistently fail otherwise so I've rolled that back. The other changes will still help reduce flakiness.

@3flex 3flex merged commit 294c408 into detekt:main May 6, 2021
@3flex 3flex deleted the build-perf branch May 6, 2021 01:56
@cortinico cortinico added this to the 1.17.0 milestone May 12, 2021
@cortinico cortinico added the housekeeping Marker for housekeeping tasks and refactorings label May 12, 2021
chao2zhang pushed a commit to chao2zhang/detekt that referenced this pull request May 13, 2021
* Only test a single older Gradle version

All other tests are run on the current Gradle wrapper version, so there's
no need to also test a recent version in this test.

* Don't spawn more workers than # CPUs

There are only 2 CPUs on Linux & Windows CI hosts, 3 on macOS, and
unknown on contributor's machines. Let Gradle pick an appropriate
default.

* Remove unneeded Gradle cache cleanup task

Issue detekt#2547 (comment)
has been fixed.
@3flex 3flex restored the build-perf branch July 29, 2021 12:12
@3flex 3flex deleted the build-perf branch July 9, 2022 05:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
housekeeping Marker for housekeeping tasks and refactorings
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants