Skip to content

Stabilize flaky integration tests from recent CI runs - #4188

Merged
T4rk1n merged 5 commits into
devfrom
test/stabilize-ci-flakes-2
Nov 24, 2026
Merged

T4rk1n merged 5 commits into
devfrom
test/stabilize-ci-flakes-2

Conversation

@T4rk1n

@T4rk1n T4rk1n commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Fixes the flaky tests from the last ~15 failed Dash Testing runs. All of them read the page before it had settled.

Fixes

  • dvcv002/004/006 (the most common): the devtools error card fades in from opacity: 0, and selenium reads text in a hidden element as "". On a slow runner the first error title came back empty. check_errors now waits for every title to be visible. It also polls for the final document.title == "Dash" check instead of reading it once.
  • Dropdown a11y006/007/008/009/010: the dropdown focuses the search input (and options, on arrow keys) one animation frame later. The tests sent keys right after the popover appeared, or after fixed sleeps, so keys sometimes went to the trigger. New helpers wait_for_search_focus and wait_for_focused_option replace the sleeps.
  • ddso002, cdpr002 (failed on this PR's first run): ddso002 had the same dropdown focus race (Selected: ['11 Text']), now uses the shared helpers in tests/dropdown_utils.py and no longer needs @flaky. cdpr002 read the end-date input before it updated; it now polls until the inputs and the callback output agree.
  • cbsc008: CI counted 12 callbacks instead of 13 because the renderer merges same-input callbacks still queued. Each keystroke now waits for the previous callback, same as cbsc001.
  • rddp001, inni003, tpag011, test_disabled_shared_storage_errors_the_callback: these asserted right after the action. They now wait for the settled state.

How it was checked
I reproduced each race locally by slowing Chrome down through CDP, then ran the old and new versions:

  • error card held at opacity 0 for 2s: old dvcv tests fail 3/3 with the CI message, new file passes 20/20
  • requestAnimationFrame delayed by 300ms: old a11y tests fail with the CI messages, new pass
  • 500ms network latency: old rddp001, inni003, tpag011 and the shared storage test fail, new pass

The fixed tests then passed 5x under latency and 5x normally, and the dcc files passed 3x.

Not in this PR

  • The dependabot pip run's typing failures are a real break from a newer mypy (dash/_pages.py:20: Need type annotation for "PAGE_REGISTRY"), not a flake.
  • The setup timeouts in slkb003 and apib001 (chromedriver read timeout, 180s pytest-timeout) look like the known teardown thread issue and need their own fix.

- check_errors: wait for the error titles to be visible (the card fades in
  from opacity 0 and selenium reads hidden text as empty), and poll for the
  settled document title.
- Dropdown a11y tests: wait for the search input or option to take focus
  (both are focused one animation frame later) instead of fixed sleeps.
- cbsc008: gate each keystroke on the previous callback, like cbsc001.
- rddp001, inni003, tpag011, shared storage: wait for the settled state
  instead of reading right after the action.
@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Dash performance benchmarks

✅ all within thresholds

scenario metric p90 (ms) median growth baseline p90 note
✅ callback_chain chain_ms 432.4 418.6 0.95x 499.1
✅ callback_chain graph_ms 2.0 2.0 1.0x 2.4
✅ callback_fanout fanout_ms 78.8 71.6 0.85x 92.5
✅ deep_nesting render_ms 49.1 45.2 1.23x 56.8
✅ full_children_replace replace_ms 149.1 82.7 2.94x -
✅ initial_render_large render_ms 496.7 471.6 1.13x 694.4
✅ initial_render_small render_ms 82.9 78.3 0.94x 104.0
✅ patch_append_nested append_ms 101.1 74.4 2.33x 192.3
✅ patch_append_toplevel append_ms 95.9 75.8 2.16x 140.2
✅ patch_scalar_update_large update_ms 110.7 104.7 0.98x 202.9
✅ rerender_existing_subtree rerender_ms 99.8 87.3 0.85x -
✅ wildcard_all_resolve wildcard_ms 258.3 249.1 0.97x 313.6
✅ wildcard_all_resolve graph_ms 1.2 1.2 1.0x 1.3

growth = late-third / early-third per-op time; ~1 is flat, a large value means the per-op cost scales with accumulated state.

machine scale vs baseline: 0.81x - divided out of the baseline ratios so they compare like for like (the absolute warn/fail ceilings are left un-scaled); calibrated on initial_render_small.

- ddso002: wait for the dropdown search input and options to take focus
  instead of sleeping; share the focus helpers in tests/dropdown_utils.py.
- cdpr002: poll until the date inputs and the callback output agree.
@sonarqubecloud

Copy link
Copy Markdown

@T4rk1n
T4rk1n merged commit 6ce83f4 into dev Nov 24, 2026
54 of 55 checks passed
@T4rk1n
T4rk1n deleted the test/stabilize-ci-flakes-2 branch November 24, 2026 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant