Skip to content

Fix Flaky Tests - #4041

Open
brandonschabell wants to merge 1 commit into
plotly:devfrom
brandonschabell:fix-flaky-tests
Open

brandonschabell wants to merge 1 commit into
plotly:devfrom
brandonschabell:fix-flaky-tests

Conversation

@brandonschabell

Copy link
Copy Markdown
Contributor

Fix flaky tests. Fix issue with input reverting to previous value during debounce

Contributor Checklist

  • I have broken down my PR scope into the following TODO tasks
    • task 1
    • task 2
  • I have run the tests locally and they passed. (refer to testing section in contributing)
  • I have added tests, or extended existing tests, to cover any new features or bugs fixed in this PR

optionals

  • I have added entry in the CHANGELOG.md
  • If this PR needs a follow-up in dash docs, community thread, I have mentioned the relevant URLS as follows
    • this GitHub #PR number updates the dash docs
    • here is the show and tell thread in Plotly Dash community

Copilot AI balanced review requested due to automatic review settings October 3, 2026 04:23
@sonarqubecloud

sonarqubecloud Bot commented Oct 3, 2026

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The regression test can pass without exercising the debounce race, and the changelog omits the user-facing fix.

Review effort: Balanced
Findings: 1 Medium severity · 1 Low severity

Open (2)
What changed in this PR

Stabilizes flaky integration tests, fixes debounced number-input stepper behavior, and improves benchmark reporting.

Changes:

  • Replaces timing sleeps and immediate assertions with condition-based waits.
  • Fixes dcc.Input stepper updates during debounce and adds regression coverage.
  • Publishes benchmark results through job summaries, including fork PRs.
File Description
tests/​websocket/​test_ws_stream.py Synchronizes streamed frame assertions.
tests/​websocket/​test_ws_get_prop.py Waits for the target element.
tests/​streaming/​test_stream_callbacks_integration.py Synchronizes progressive rendering.
tests/​integration/​test_csp.py Waits for callback output.
tests/​integration/​renderer/​test_dependencies.py Replaces retries with explicit waits.
tests/​integration/​devtools/​test_callback_validation.py Waits for visible error titles.
tests/​integration/​callbacks/​test_basic_callback.py Synchronizes callbacks per keystroke.
tests/​conftest.py Delays forced exit until pytest teardown.
tests/​background_callback/​test_basic_long_callback008.py Avoids problematic disk-cache locking.
components/​dash-table/​tests/​selenium/​test_pagination.py Waits for pagination state.
components/​dash-core-components/​tests/​integration/​store/​test_component_props.py Uses timestamp bounds instead of tolerance.
components/​dash-core-components/​tests/​integration/​input/​test_number_input.py Adds debounce-stepper regression coverage.
components/​dash-core-components/​tests/​integration/​dropdown/​test_dropdown_search_order.py Synchronizes dropdown focus and filtering.
components/​dash-core-components/​tests/​integration/​dropdown/​test_a11y.py Replaces retries with focus-aware waits.
components/​dash-core-components/​src/​components/​Input.tsx Prevents stale debounced stepper updates.
CHANGELOG.md Records test stabilization.
.github/​workflows/​benchmarks.yml Writes benchmark results to job summaries.
.ai/​PERFORMANCE.md Documents benchmark reporting behavior.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +299 to +303
for _ in range(5):
increment_btn.click()
dash_dcc.wait_for_text_to_equal("#div-fast", "103")
decrement_btn.click()
dash_dcc.wait_for_text_to_equal("#div-fast", "100")
Comment thread CHANGELOG.md
- [#3986](https://github.com/plotly/dash/pull/3986) Adjust `_run_before_hooks` in the `fastapi` backend to honor a response returned by a `before_request` function, matching the `flask` backend's behavior.

### Fixed
- [#4041](https://github.com/plotly/dash/pull/4041) Fix flaky integration tests by replacing fixed sleeps and immediate asserts with waits, and remove their `@flaky` retry markers.
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.

2 participants