Fix flaky admin users system spec #4875
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.
Doesn't resolve any issue. Relate to flaky specs issue (#4557).
Description
Example build failure: https://github.com/rubyforgood/human-essentials/actions/runs/12431427850/job/34708824591
Example output:
Theory behind flakiness, this line in the test:
is filling in the select2 input field as if a human would (letter by letter). Every time you input a letter, another request is sent to filter those resources (which could be done locally instead of over a request but that's another topic).
This ends up sending a bunch of requests as seen in the test logs:
I think these requests create a race condition.
So instead of inputting the text, we just select the option. And it seems to fix the flakiness.
Type of change
How Has This Been Tested?
I ran this test locally 20 times before and after the changes. Before it failed 4 times, after it failed 0 times.