-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[10121] Fix random PyPy CI failures. Improve GHA CI speed. Improve coverage reporting. #1543
Conversation
9ffbc37
to
03e42c1
Compare
|
|
bc18121
to
e542130
Compare
bbec8bc
to
9300a7d
Compare
37f9a03
to
6243c19
Compare
8745b5d
to
4c52eec
Compare
| @@ -12,4 +19,12 @@ coverage: | |||
| default: | |||
| target: 100% | |||
|
|
|||
| comment: off | |||
| # We don't want to receive general PR comments about coverage. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are already the defaults, but I have added them here to make it explicit and help undestand how the whole codecov.io process works
| require_ci_to_pass: yes | ||
| notify: | ||
| after_n_builds: 7 | ||
| wait_for_ci: yes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here I am trying to see if I can configure codecov.io to wait a bit more before sending the coverage reports so that we don't have transient red checks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the existing behavior is bad, necessarily, it's just confusing for people who (like me) assume that a check is complete once it shows either a check or X.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my experience these two options don't actually work. I never got to the bottom of why and codecov.io declined to assist.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will try to find some time and report this issue via the internal / paid support codecov channel.
It is true that codecov are not helping too much with open source projects... so we are on a free ride here.
But I see if I can reproduce it for my private project and try to get help via that project.
|
I have no idea why This is ready for review. See PR description |
| run: | | ||
| # sub-process coverage are generated in separate files so we combine them | ||
| # to get an unified coverage for the local run. | ||
| # The XML is generate to be used with 3rd party tools like diff-cover. | ||
| python -m coverage combine | ||
| python -m coverage xml -o coverage.xml -i | ||
| python -m coverage report | ||
| python -m coverage report --skip-covered |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
.github/workflows/test.yaml
Outdated
| @@ -36,6 +36,8 @@ jobs: | |||
| # As of 9 March 2021 GHA VM have 2 CPUs - Azure Standard_DS2_v2 | |||
| # Trial distributed jobs enabled to speed up the CI jobs. | |||
| trial-args: ['-j 4'] | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be removed as you removed the reference to it above?
|
@twm thanks for the review. I have updated the GHA config. Let me know if you see any issues with it. I see the codecov.io check is still sent before all checks are done The codecov.io docs say that cryptography project is a good example The codecov/project is now red ...but I guess that after some time codecov.io is preocessing the reports and will update it. The codecov page looks green https://app.codecov.io/gh/twisted/twisted/compare/1543/changes I happened with my previous comment. By the time I left the comment the check was red for a5326cc and now it's green My plan is to rewrite the coverage reporting in a separate PR, so that we collect all GHA coverage in a separate job and combine ourselves and then send a single coverage.xml for the whole GHA builds... I will test in in a separate branch ... but might need moving one Windows and MacOS job to GitHub |
It looks like the change is due to a now-untested branch in |
Thanks. You are my hero :) Updated pypy coverage only take 3 minutes.. 7 minutes is the total run time for GitHub Actions tests. We still have Azure tests which take 14m. So with the changes from this PR GHA should be ok and we should look at Azure speedup next |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, although I'm not terribly familiar with codecov.io+GHA interactions.
…nto 10121-pypy-no-coverage
| # Future test runs will not trigger the error and the error handling | ||
| # code branch is not called, and if no other tests is touching that | ||
| # branch we are left with overall reduced code coverage. | ||
| threshold: 0.02% |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This setting may be required if coverage is a required check but the reasoning here is invalid. The threshold value allows an ongoing slip in coverage. Build N of trunk can have (0.02 × M) greater coverage than build (N+M) of trunk and this configuration tells codecov.io that this is fine.
So this setting should be considered a temporary fix while the real problem is being addressed - non-deterministic coverage in the test suite.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are various cases where coverage can be reduced. Even just deleting lines that have been covered causes this. It's just a result of not having '100%' coverage (after including consideration of coverage ignores). I don't know if there's a way to deal with that separately from the commented situation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are the odds, that is the case in my next review. twisted/towncrier#334 They deleted a line that is useless and the coverage dropped by 0.01%.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks wiml for the review. Just monitoring future PR and checking for overall project coverage regression can help with future fixed for this issue.
Thanks exarkun for the headup. I forgot to file the followup ticket.
Thanks altendky for the code delete info. I was hoping that codeco.io is smart and will not trigger such an error.
I have reported this issue
https://community.codecov.io/t/project-coverage-decrease-on-deleted-line/2726
I agree that this should be a temporary change.
I have added to link to the ticket in the comment.
If coverage/project will continue to be red, people will most probably ignore it by default.
With that, I think that is a higher probability of seeing an overall decrease in coverage.
We had the project red for some time, and I am not aware of any secondary tickets or actions to fix the overall project coverage.
Regarding 0.02 x M.
We have 100% patch coverage , so is not that easy to find a series of PR with 100% patch coverage but witch will always decreased the overall project by 0.02 due to different tests.
I am monitoring overall coverage changes as there is a gang of usual suspect tests.
For example
With this swinging line
There is also this swinging test helpers to prevent a flaky test failure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To gain more speed, I have removed tox --notests as it was just wasting time.
I guess that should be brought back in #1577 after this PR is merged?
| # Future test runs will not trigger the error and the error handling | ||
| # code branch is not called, and if no other tests is touching that | ||
| # branch we are left with overall reduced code coverage. | ||
| threshold: 0.02% |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are various cases where coverage can be reduced. Even just deleting lines that have been covered causes this. It's just a result of not having '100%' coverage (after including consideration of coverage ignores). I don't know if there's a way to deal with that separately from the commented situation.



Scope and purpose
We got random failures on pypy (both 3.6 and 3.7 versions)
Also pypy jobs with coverage are very slow...30minutes.
See what can be done to speed up the CI.
Changes
PYPY coverage
Coverage was disabled for most of the PyPy..
The tests are much faster now without coverage 4m vs 30m
We still run coverage on PYPY, but only for compat and a few other test that are exercising the PYPY specific code.
In this way we can monitor if we continue to see random CI failures at the end of the test run on PY.
These are the tests required to get the extra coverage on pypy
Linux / MacOS general CI speedup
All tests are now executed in parallel, including pypy.
To gain more speed, I have removed
tox --notestsas it was just wasting time.We can later show the dependencies using the python-info action.
PR are waiting to be reviewed to also get parallel jobs on Windows.
Coverage reporting
I have updated coverage XML generation and codecov.io reporting to make the check red on failures.
Only coveralls failures are ignored for now.
In this way it should be easier to observer coverage issues.
I tried to fix the coveralls report for trunk merges.
I did some work in #1574 but there is no way to test this unless merged in trunk.
Contributor Checklist:
tox -e lintto format my patch to meet the Twisted Coding Standardreviewto the keywords field in Trac, and putting a link to this PR in the comment; it shows up in https://twisted.reviews/ now.