Fix flaky ExportCreateService spec #4862
Open
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.
Doesn't resolve any issue.
Description
I believe this is one of the more flaky specs we have.
This spec expects the requests in the export to be in a particular order, but no order is applied to the requests passed in and no order is defined in the ExportCreateService itself, hence the flakiness.
Example rspec output:
Explanation: is expecting the the second line to equal the second request defined in the setup. But since
Request.all
are the arguments, no order is defined, and that request is there but on a different line.Type of change
How Has This Been Tested?
It's hard to reproduce this flakiness on command. While I was debugging it, I ran
--bisect
with the seed number, but it wasn't helpful in this case.It's possible this test is flaky for a different reason. But let's take care of this issue first.
Screenshots
Example failure in CI: https://github.com/rubyforgood/human-essentials/actions/runs/12353561322/job/34472934783#step:7:1433