Fix flaky family requests system spec #4867
Merged
+4
−4
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, although related to #4557.
Description
This system spec is known to be flaky. See this comment.
Example failure: https://github.com/rubyforgood/human-essentials/actions/runs/12392348304/job/34591567923#step:7:552
Example output:
Proposed reason behind flakiness:
We are expecting the requested items (Items Needed column) for each child to be in a certain order.
But in the view we are calling
child.requested_item_ids
to fetch the items which doesn't specify anORDER BY
clause (nor do we sort the items in Ruby), as you can see from development logs:or from Rails console:
Type of change
How Has This Been Tested?
I retried this spec 10+ times locally and wasn't and wasn't able to reproduce the failure.
But I changed the order of the
requested_item_ids
for thepartners_child
factories and the test still passes afterwards, so I think this will fix the issue.Screenshots
Which page we are testing for reference: