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

Flaky specs: Use travel_back when travel_to is used #6054

Merged
merged 2 commits into from
Sep 26, 2024

Conversation

thejonroberts
Copy link
Contributor

What github issue is this PR for, if any?

None. Fixes flaky specs.

What changed, and why?

Added travel_back wherever travel_to is used.

I was seeing a lot of spec failures locally when making a change that were seemingly unrelated to my changes. This fixed them. A lot of places where travel to was used without a travel back. (Probably an assumption that this was done automatically). Could possibly do travel_back in an after(:each) block in spec_helper.rb instead. Would mean doing for every test, not just time-traveling specs, and I errored on the side of being explicit. The benefit of the spec helper approach would be that it won't ever be a problem again...

Copy link
Collaborator

@elasticspoon elasticspoon left a comment

Choose a reason for hiding this comment

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

1 small comment but overall LGTM

spec/requests/health_spec.rb Outdated Show resolved Hide resolved
@elasticspoon
Copy link
Collaborator

@thejonroberts could you fix the lint on this?

@thejonroberts
Copy link
Contributor Author

updated @elasticspoon

@elasticspoon elasticspoon merged commit 69d3b13 into rubyforgood:main Sep 26, 2024
17 checks passed
@thejonroberts thejonroberts deleted the travel_back_flaky_specs branch September 26, 2024 02:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ruby Pull requests that update Ruby code Tests! 🎉💖👏
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants