Skip to content

Conversation

@cte
Copy link
Collaborator

@cte cte commented Jun 23, 2025

Flake example: https://github.com/RooCodeInc/Roo-Code/actions/runs/15827839172/job/44612609101?pr=5044

From Roo Code:

Fixed the flaky TemperatureControl test that was failing on win32 CI by replacing hardcoded setTimeout delays with waitFor from @testing-library/react.

Problem: The test was using a fixed 100ms timeout to wait for the debounced onChange callback, but the component uses useDebounce with only a 50ms delay. On slower CI environments like win32, this timing mismatch caused intermittent failures.

Solution: Replaced the hardcoded delays with waitFor utility that polls until the expected condition is met, making the test timing-independent and more reliable across different environments.

Changes:

  • Added waitFor import
  • Replaced both setTimeout calls with waitFor blocks that wait for the specific expectations

The test now passes consistently and all 457 tests in the webview test suite continue to pass.


Important

Replaced setTimeout with waitFor in TemperatureControl.spec.tsx to fix flaky test on win32 CI.

  • Test Reliability:
    • Replaced setTimeout with waitFor in TemperatureControl.spec.tsx to fix flaky test on win32 CI.
    • Ensures onChange callback is called correctly by waiting for debounced changes.
  • Imports:
    • Added waitFor import from @testing-library/react in TemperatureControl.spec.tsx.

This description was created by Ellipsis for 28d9cdb. You can customize this summary. It will automatically update as commits are pushed.

@cte cte requested review from jr and mrubens as code owners June 23, 2025 15:17
@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. bug Something isn't working labels Jun 23, 2025
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jun 23, 2025
@cte cte merged commit 0a8c55c into main Jun 23, 2025
22 checks passed
@cte cte deleted the cte/temp-control-win32-flake branch June 23, 2025 15:48
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Jun 23, 2025
@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Jun 23, 2025
cte added a commit that referenced this pull request Jun 24, 2025
Alorse pushed a commit to Alorse/Roo-Code that referenced this pull request Jun 27, 2025
Alorse pushed a commit to Alorse/Roo-Code that referenced this pull request Jun 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working lgtm This PR has been approved by a maintainer size:S This PR changes 10-29 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants