Skip to content

fix: Reduce flakiness of a budget spec#23122

Open
thykel wants to merge 1 commit intodevfrom
flaky_budget_test
Open

fix: Reduce flakiness of a budget spec#23122
thykel wants to merge 1 commit intodevfrom
flaky_budget_test

Conversation

@thykel
Copy link
Copy Markdown
Contributor

@thykel thykel commented May 7, 2026

updating a budget with new cost items creates the cost items
       Failure/Error: example.run
         expected to find visible css "#budget_new_material_budget_item_attributes_0_costs" with text "150.00 EUR" but there were no matches. Also found "0.00
   EUR", which matched the selector but not all filters.
  • The Stimulus controller's valueChanged uses a 100ms debounce before firing the fetch
  • wait_for_network_idle in Ferrum polls for pending connections (pending_connections <= 0) — if called before the debounce fires, it sees no in-flight requests and returns immediately
  • have_css then retries for 4s, but this appears inconsistent on CI under load

The fix: apply the two-phase wait pattern (wait_for_network_idle; sleep(0.15); wait_for_network_idle) — the first call handles any in-flight requests, the sleep ensures the 100ms debounce fires, and the second call waits for the resulting fetch. This matches the existing pattern for debounced requests in this codebase.

@thykel thykel changed the title fix: Remove flakiness from a budget spec fix: Reduce flakiness of a budget spec May 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant