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

Add Mechanism to prevent adding new unstable flaky to test #5226

Closed
anasalkouz opened this issue Nov 12, 2022 · 6 comments
Closed

Add Mechanism to prevent adding new unstable flaky to test #5226

anasalkouz opened this issue Nov 12, 2022 · 6 comments
Labels
enhancement Enhancement or improvement to existing feature or request flaky-test Random test failure that succeeds on second run

Comments

@anasalkouz
Copy link
Member

Is your feature request related to a problem? Please describe.
Recently, We observe more flakiness on our tests because of newly created tests or updates on existing tests, like the following 2 examples:
#5189
#5031

Describe the solution you'd like
I am looking for a mechanism to avoid this from happening again, this could be by manual or an automated process, like maintainers should not approve PR that has new test without providing 100+ successful run with no failures.

Looking to for better alternatives

@anasalkouz anasalkouz added enhancement Enhancement or improvement to existing feature or request untriaged flaky-test Random test failure that succeeds on second run and removed untriaged labels Nov 12, 2022
@anasalkouz anasalkouz changed the title Add Mechanism to prevent adding new unstable flakey to test Add Mechanism to prevent adding new unstable flaky to test Nov 12, 2022
@anasalkouz
Copy link
Member Author

@pranikum @imRishN @xuezhou25
Would like to know your thoughts on this?

@andrross
Copy link
Member

This PR in the Gradle test-retry plugin is an interesting idea. The general approach is to identify tests that are added or changed as a part of a commit, then re-run those tests many times as a part of the build. The idea is to catch flakiness immediately so the developer that already has the context can fix them right away. This functionality doesn't exist in the test-retry plugin yet but it could be added.

@reta
Copy link
Collaborator

reta commented Nov 14, 2022

@andrross a bit different approach is taken by Jenkins (if I am not mistaken): the tests diff is taken from JUnit XML reports (we also have them). So basically the idea would be:

  • fetch the reports from upstream branch (main, 2.x, ..)
  • compare with the report for current pull request (there could be new test cases in existing suites or completely new test suites)

The question is: when should be run such check? We probably should not be running it on each change in pull request (however it could be useful sometimes), but certainly before the pull request gets merged.

@dblock
Copy link
Member

dblock commented Nov 15, 2022

I propose new tests be rerun with N random seeds as part of gradle check (or a new gradle check for new tests).

note Jenkins seems to know what’s new because it marks existing failing tests as regressions and marked builds unstable

@andrross
Copy link
Member

andrross commented Dec 5, 2022

While I do think this is an interesting idea, our quick approach of surfacing flakiness directly in a PR comment (#5200) seems to be working well for surfacing flakiness. It does require manual work from authors and reviewers to notice the failure, create an issue, and (for recently introduced flakiness) notify the original author, but I do believe this is working reasonably well now. I'm inclined to close this issue because I don't think anybody is going to take up this work in the near term to improve the automation here. @dblock @reta what do you think?

@dblock
Copy link
Member

dblock commented Dec 6, 2022

Let's close.

I'd a lot of things, like a Jenkins plugin that manages flaky test GitHub issues, but maybe we don't need to do that much engineering ;)

@dblock dblock closed this as completed Dec 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement or improvement to existing feature or request flaky-test Random test failure that succeeds on second run
Projects
None yet
Development

No branches or pull requests

4 participants