fix: TomSelect test helper flake — use JS value-set instead of send_keys - #2752
Merged
Conversation
mroderick
marked this pull request as ready for review
July 28, 2026 16:03
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.
What
Replace
send_keyswith JS value-set +dispatchEvent('input')in the TomSelect test helper. Bypasses the keystroke synthesis pipeline that can race with TomSelect's 300msloadThrottledebounce timer under CPU contention in parallel CI.Why
select_from_tom_selectintermittently times out waiting for.ts-dropdown .optionin headless CI (observed in PR #2750, Group 1, seed 55042). The existing focus fix (PR #2741) reduced but didn't eliminate the flake.Root cause:
send_keysdispatches 3 rapid keystrokes, each resetting TomSelect's internalsetTimeout(300)for theloadcallback. The debounce timer can starve when parallel test processes contend for CPU, and the AJAX search never fires.Fix: set
input.valueand dispatchnew Event('input', {bubbles: true})viaexecute_script. No focus dependency, no rapid-keystroke race, just one direct mutation that TomSelect'sonInputhandler processes synchronously.Verification
managing_meeting_invitations_spec.rb+meeting_spec.rb) in 10 sequential runs