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

Retry flaky specs automatically #4893

Merged
merged 2 commits into from
Feb 1, 2023

Conversation

kennyadsl
Copy link
Member

Summary

Increasing our testing matrix on the CI, we are being hit more often by the flaky specs we have around. Until we have time and will to fix them, we can now explicitly mark those specs as flaky and retry them multiple times automatically leveraging the rspec-retry library.

This will have the benefit of saving CI time along with maintainers' time, who have to continuously open CircleCI and rerun the failing jobs, which in turn will rerun the whole test suite.

This PR adds a wrapping testing support helper for flaky specs. This helper relies on rspec-retry, which will retry flagged specs when they fail. We can use this helper when we have flaky specs that we cannot solve.

The retry mechanism is only enabled in the CI environment.

Checklist

Check out our PR guidelines for more details.

The following are mandatory for all PRs:

  • I have written a thorough PR description.
  • I have kept my commits small and atomic.
  • I have used clear, explanatory commit messages.
  • I have documented new code with YARD.

The following are not always needed (cross them out if they are not):

  • I have added automated tests to cover my changes.
  • I have attached screenshots to demo visual changes.
  • I have opened a PR to update the guides.
  • I have updated the README to account for my changes.

This helper relies on rspec-retry, which will retry
flagged specs when they fail. We can use this helper
when we have flaky specs that we are not able to solve.

The retry is only enabled in the CI environment.
@kennyadsl kennyadsl added the type:enhancement Proposed or newly added feature label Jan 31, 2023
@kennyadsl kennyadsl requested a review from a team as a code owner January 31, 2023 22:00
@kennyadsl kennyadsl self-assigned this Jan 31, 2023
@github-actions github-actions bot added changelog:repository Changes to the repository not within any gem changelog:solidus_backend Changes to the solidus_backend gem changelog:solidus_core Changes to the solidus_core gem labels Jan 31, 2023
@kennyadsl kennyadsl removed changelog:solidus_backend Changes to the solidus_backend gem changelog:solidus_core Changes to the solidus_core gem labels Jan 31, 2023
@kennyadsl kennyadsl force-pushed the kennyadsl/flacky-retry branch from d96e2d7 to a652113 Compare January 31, 2023 22:14
@github-actions github-actions bot added changelog:solidus_backend Changes to the solidus_backend gem changelog:solidus_core Changes to the solidus_core gem labels Jan 31, 2023
@kennyadsl kennyadsl force-pushed the kennyadsl/flacky-retry branch from a652113 to 24eec8d Compare February 1, 2023 08:21
This will trigger a retry in the CI when they fail.
@kennyadsl kennyadsl force-pushed the kennyadsl/flacky-retry branch from 24eec8d to ee52b9f Compare February 1, 2023 08:48
Copy link
Member

@spaghetticode spaghetticode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really like this, thanks @kennyadsl 🎉 👍

Copy link
Contributor

@waiting-for-dev waiting-for-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@waiting-for-dev waiting-for-dev merged commit 6d19135 into solidusio:master Feb 1, 2023
@waiting-for-dev waiting-for-dev deleted the kennyadsl/flacky-retry branch February 1, 2023 11:32
@kennyadsl kennyadsl mentioned this pull request Feb 14, 2023
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:repository Changes to the repository not within any gem changelog:solidus_backend Changes to the solidus_backend gem changelog:solidus_core Changes to the solidus_core gem type:enhancement Proposed or newly added feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants