Repository navigation
test(ui): inject the auto-router availability debounce so saves settle deterministically - #42936
Open
devin-ai-integration[bot] wants to merge 3 commits into
Open
devin-ai-integration[bot] wants to merge 3 commits into
devin-ai-integration[bot] wants to merge 3 commits into
Conversation
…e deterministically Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
devin-ai-integration
Bot
requested review from
ryan-crabbe-berri and
yuneng-berri
as code owners
September 24, 2026 10:33
|
|
Contributor
|
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…at 0ms Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
mateo-berri
enabled auto-merge (squash)
September 24, 2026 12:31
4 of 6 tasks
mateo-berri
disabled auto-merge
September 28, 2026 18:36
This was referenced Sep 30, 2026
This was referenced Oct 7, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
TLDR
Problem this solves:
edit_auto_router_modal.integration.test.tsxflaked on main about 14 times in 24 hourswaitForHow it solves it:
renderWithProvidersinjects 0ms, which resolves the debounce synchronously with no timerUser Flow
Before: a maintainer's unrelated PR goes red on the UI unit tests job for the auto-router edit modal
UI Unit Testsrun failsexpect(element).toBeEnabled()on the modal's Save button withdisabled=""After: the same job is green on the first attempt because the Save gating no longer waits on a real timer
UI Unit Testsrun passesFlakes covered, by run date
2026-09-23 and 2026-09-24
src/components/edit_auto_router/edit_auto_router_modal.integration.test.tsx > EditAutoRouterModal keyword matching > hydrates the saved threshold and saves an edit to '0'and the''case, plus the same signature on other cases of the file (classifier vision > hydrates and keeps a stored vision setting through an untouched savereproduced locally)CI evidence, all
UI Unit Testsattempt 1 failures on main interleaved with passing runs at adjacent SHAs of the same job:The same test also failed on several PR branches in the window (about 23 failing runs total) and passed on re-run. Locally it reproduced once under
--sequence.shuffle --maxWorkers=7and then passed with no editsMechanism: wall-clock dependence.
useAutoRouterAvailabilitydebounces the serialized router config with a real 300mssetTimeoutand the modal keeps Save disabled with "Checking availability" until that timer fires and the availability query settles. Even an untouched save pays the debounce because hydrating the form changes the serialized config after mount. Unloaded, these tests already take about 800ms, so the default 1000mswaitForceiling is crossed whenever the CI runner is contendedFix: the delay is dependency-injected through
AutoRouterAvailabilityDebounceContext(default 300ms) and the shared test renderer provides 0ms. At 0ms the hook derives the debounced value directly instead of scheduling a timer: asetTimeout(0)still costs a task hop plus a re-render per config change, and that revision (bd7fef2) still failed the same two tests in CI. The test that asserts Save is blocked while a change is being checked keeps its meaning because that state comes from the pending availability fetch, not from the timer. Mutation check: hardcoding the modal's blocked reason made 56 of 64 cases in the file fail, including the two flaky ones, then the mutation was revertedA/B under contention (14 forked workers pinned to one CPU with
taskset -c 0, the three auto-router integration files, alternating runs): the merge base 04f3ade failed 10 of 10 runs with the exact CI signature, 25 failing cases in total across 11 hydration and save tests; the PR tip 4e9eace passed 10 of 10 runs and kept the modal file green in 3 shuffled runs. Logs live in the automation's evidence directoryPre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
uv run pytest tests/test_litellm/<your_test_file>.py -v. Leave the suites (make test-unit-*,make test-unit) to CI: it finishes in ~15 minutes where a laptop takes an hour or more@greptileaito re-request a review after pushing changes)Type
✅ Test
Caveats (if any)
Low
renderWithProviderstree now sees a 0ms availability debounce, only auto-router components read itadd_auto_router_tab.integration.test.tsxshows a separate tuning-alert race that never flaked in CI, left for a future runFinal Attestation
Link to Devin session: https://app.devin.ai/sessions/1f6fea308eb141e78860c892cd6f6551
Open in Devin Desktop: https://app.devin.ai/desktop/session/1f6fea308eb141e78860c892cd6f6551?variant=devin