Fix TemperatureControl test flake #5045
Merged
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.
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
setTimeoutdelays withwaitForfrom@testing-library/react.Problem: The test was using a fixed 100ms timeout to wait for the debounced onChange callback, but the component uses
useDebouncewith only a 50ms delay. On slower CI environments like win32, this timing mismatch caused intermittent failures.Solution: Replaced the hardcoded delays with
waitForutility that polls until the expected condition is met, making the test timing-independent and more reliable across different environments.Changes:
waitForimportsetTimeoutcalls withwaitForblocks that wait for the specific expectationsThe test now passes consistently and all 457 tests in the webview test suite continue to pass.
Important
Replaced
setTimeoutwithwaitForinTemperatureControl.spec.tsxto fix flaky test on win32 CI.setTimeoutwithwaitForinTemperatureControl.spec.tsxto fix flaky test on win32 CI.onChangecallback is called correctly by waiting for debounced changes.waitForimport from@testing-library/reactinTemperatureControl.spec.tsx.This description was created by
for 28d9cdb. You can customize this summary. It will automatically update as commits are pushed.