Repository navigation
test(managed-oauth): give device login completion a load-tolerant budget - #2233
Conversation
yyhhyyyyyy
left a comment
There was a problem hiding this comment.
Approved at 1c305c3. No findings.
The net diff against origin/main a8d84e9 is one test file, crates/dim-app-server/tests/managed_oauth_flow.rs (+15/-21). A wait_for_login helper replaces the three copies of the 3 s guard that waited for a device attempt to leave Pending after the token response. The helper keeps the same poll loop and the same failure message and bounds the wait at 30 s; the tests still assert the completed login and the requests that follow. No product, fixture or assertion change.
Checks:
- The three old guards are gone;
wait_for_login(crates/dim-app-server/tests/managed_oauth_flow.rs:316-324) is the only completion wait. The remaining 3 s guards in the file are unrelated waits onstarted.notified()and disposal (:567,:578,:798). - A genuine stall still fails: the helper times out at 30 s with the existing message, and a non-
Pendingfailure leaves the loop for the existingCompletedor authenticated assertion to catch. - The 10 s token-response guards at
:1021,:1401and:1771are unchanged. They wait for the fixture's token response, a different step from the completion wait this PR targets, so the narrower scope is right. - Merge-tree with origin/main a8d84e9 is clean (tree 299c911e695576226d69c43d2afbc04dd493db8b); the head's parent is a8d84e9, so the PR is based on current main.
cargo fmt --all -- --checkpasses.
Verification: targeted runs with the pinned 1.100.0 toolchain, an isolated home, TMPDIR, XDG and CARGO_TARGET_DIR under the review data directory, LC_ALL=en_US.UTF-8, and CARGO_NET_OFFLINE=true. Both affected tests pass at this head with --test-threads=1: managed_oauth_flow::managed_provider_selection_http_recovery_and_restart_flow (1 passed, 3.76 s) and managed_oauth_flow::the_managed_grok_route_takes_only_the_native_xai_image_formats (1 passed, 1.13 s).
CI at 1c305c3 (run 45805846631): changes and macos-native pass; verify (linux) is in progress; the other jobs skip on the path filter.
Verdict: APPROVE. This is a test-only flake fix: the wait is a guard, not the behaviour under test, and 30 s still fails a real stall well inside the job budget.
zerob13
left a comment
There was a problem hiding this comment.
Approved at 1c305c3af633a94103cbf88089056bfdcd354a4c.
The test-only delta replaces three completion guards across two OAuth tests, without changing product behavior, the separate device-flow deadline checks, or the downstream assertions. The two affected tests and the dedicated device-flow test passed in exact Linux CI. That job separately failed two storage/startup tests outside the edited path; their underlying cause is unverified. ci-ok is red and still gates merge.
Summary
Three
managed_oauth_flowtests waited for the device attempt to leavePendingwith a 3 s guard:The completion deadline is not what these tests assert; they assert the completed login and the requests that follow. Under whole-suite load the exchange can take longer than 3 s, and this produced repeated unrelated failures in PR #2229's verify.
The three copies now call one
wait_for_loginhelper with a 30 s test budget and the existing message. No product code or assertion changes.Fixes #2232. Part of #2217.
Design rule checklist
beforecallbacks: n/a — no Timeline writes.Documentation
Verification
managed_oauth_flow::managed_provider_selection_http_recovery_and_restart_flow— passed twice.managed_oauth_flow::the_managed_grok_route_takes_only_the_native_xai_image_formats— passed twice.cargo clippy --locked -p dim-app-server --test app_server_flow -- -D warnings— passed.cargo fmt --all -- --check— passed.