-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
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
CI: prevent false negatives in builds for pull requests #39835
Comments
I don't have a lot of experience but I'll share my pattern FWIW. c.33% of the time I will have some test failure that is unrelated to my changes. I assume that this is just a random fail (from an flakey system) or that bugs from other core devs merges will get patched, so I just wait a day or so, re-merge upstream and then see how the chips fall. I recently also had a failing I rely on cross checks to ensure my code is reliable. Not sure how this fits in to the CI runs but defining what tests to run based on source code changes would be very difficult I think, and occasionally I have found errors in tests areas I would not expect to be related which led to corrective action. |
Hi @afeld
I recall @jorisvandenbossche saying this was already the case (though I haven't tried force pushing to master to check)
This would hide a lot of errors - even just not having merged latest changes recently enough can hide errors (example), so I don't think this is a possibility |
we do not force push to master and it would fail as the branch is protected |
I know the point of the issue is not this specific case of a failure, but just to explain what it was (because I think the pattern is useful to understand how such things can happen and could be prevented): that was a bug in a PR merged to master (#39769), and which was quickly thereafter fixed by the author of the PR (#39829). You updated your PR in the few hours between those two PRs, and thus pulled in the failures. The reason that the bug was not catched on the original PR (CI was green on that PR), is probably because of a bad interplay with another change that was just merged before merging that PR. Ideally, you would always merge master to have a CI run that is fully up to date before merging a PR. In practice we actually often do that, but it's also not always practical when merging multiple PRs (because for each PR it takes quite a while to merge master / run CI). (I think if we want to solve this problem, we should look at some kind of "auto-merge bot" that ensures CI is green with latest master before merging)
I think this is something much more common, and indeed quite annoying (but often they are also annoying to figure out / fix). Recently I have seen regularly some unrelated failures due to ResourceWarnings.
That would mainly reduce CI time, but not necessarily make it more reliable I think. As @attack68 mentioned, determining which tests to run is not that easy, and will probably regularly give false negatives, potentially causing a broken master more often.
I think one problem might be that the error message is not that easy to find in the build log? (this might be something that could be improved) About not executing these old whatsnew files anymore, there is an old issue about this: #6856 |
GitHub just added an option to automatically merge on green. Probably useful for you maintainers regardless!
The protected branch setting I was thinking of was requiring checks to pass before merging. Sounds like we don't think that (accidentally?) merging pull requests with failing checks is a problem, so that wouldn't necessarily help. There doesn't seem to be a built-in feature for ensuring merges would be a fast-forward (that
Fair.
Couldn't hurt! Even so, in the example above, even once I found the error, I was confused as to why it would be appearing. All that to say: sounds like the problems don't have one easy fix. I'll close this issue since it isn't actionable, but happy to continue the conversation and track issues that make sense to split out of it. Thanks for chiming in, all! |
If we know the failure is unrelated (eg a flaky build that is not yet solved), we currently indeed might merge without having a fully green CI. But note that in the specific example given above, the PR that caused master to fail was actually green on the PR. So requiring checks to pass wouldn't have solved such case.
You ran into a particular strange issue, for which I also don't have an explanation .. Sphinx is notoriously hard (but from my experience, most of the time doc build issues are more easy to understand, at least if you have some familiarity with the pandas doc build)
Yeah, and in addition, CI work like tracking down a flaky build is both not the most easy nor satisfactory issue to work on .. |
I have confirmed this bug exists on the latest version of pandas.Problem description
This issue is a bit vague, because I'm not sure that I completely understand the problem. And/or it's multiple problems. Anyway:
I have opened a handful of pull requests on pandas recently, and it seems that each time I do (or when I rebase), tests fail for a different reason…unrelated to my change. In #39364, for example, the build was failing because of:
ipython
cell run back in thewhatsnew
entry for v0.8.0 (fixed in DOC: skip evaluation of code in v0.8.0 release notes #39801, thenAttributeError: 'float' object has no attribute 'value'
errorAnyway, the point is not those specific errors, but that the pandas build is relatively fragile. Upstream issues cause builds for pull requests to fail with errors that have nothing to do with the change, which is confusing for people trying to contribute. This could be because:
Some ideas of how to help:
master
Curious to hear ideas from maintainers about if there are patterns of things going on that could be fixed. I imagine it makes sense to split more actionable issues and close this one after some discussion; defer to maintainers on that as well. Thanks!
The text was updated successfully, but these errors were encountered: