Fix TomSelect test helper flake: search queries that can never match - #2874
Merged
Merged
Conversation
The helper typed member.full_name into TomSelect, but full_name includes pronouns — "Jane Doe (she/her)" — while /admin/members/search only matches CONCAT(name, ' ', surname) and email. Queries containing the pronoun suffix matched nothing server-side, and TomSelect caches loads per query (loadedSearches), so an empty or failed fetch poisoned that query string permanently: options never appeared and the 15s wait could not recover. Type a pronoun-free query, wait briefly for the 3-character results, and if none appear retype the full name as a fresh query (new cache key, new fetch). Adds a regression scenario that aborts the first search request via Playwright routing to exercise the retry deterministically.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Fixes the recurring CI flake where
select_from_tom_selectfails withexpected to find css ".ts-dropdown .option" but there were no matches(e.g. CI on #2851, previously #2740, #2803).Root cause
Two problems compound:
Member#full_nameincludes pronouns ("Jane Doe (she/her)"), and the helper typed it into TomSelect./admin/members/searchonly matchesCONCAT(name, ' ', surname)and email, so any query containing the pronoun suffix returns no members. Verified by dumping TomSelect state at failure:inputValue: "Ezequiel Bernier (she/her)", dropdown renders "No members found" despite the fetch succeeding.loadedSearchesin the vendoredtom-select.complete.min.js), so once a query fails or returns empty, that exact query never re-fires. The old helper's 15-second wait could never recover from one bad fetch.Fix
managing_meeting_invitations_spec.rbthat aborts the first search request via Playwright route interception, deterministically exercising the retry path.Testing
parallel_rspec spec/ -n 6: 1342 examples, 0 failures.managing_meeting_invitations_spec.rb,meeting_spec.rb) run 5× clean.