Flaky specs: Use travel_back when travel_to is used #6054
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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...