Skip to content

test(managed-oauth): give device login completion a load-tolerant budget #2232

Done

Description

@eric8810

Part of #2217.

Context

crates/dim-app-server/tests/managed_oauth_flow.rs has three copies of:

tokio::time::timeout(Duration::from_secs(3), async {
    while grok.attempt_status(begin.attempt_id).await.unwrap() == AttemptStatus::Pending {
        tokio::time::sleep(Duration::from_millis(10)).await;
    }
})
.await
.expect("the device login did not complete after the token response");

The wait is a guard, not the behavior under test: the tests assert the completed login and the requests that follow. Under whole-suite load the exchange can take longer than 3 s; PR #2229's verify hit this twice on unrelated runs.

Scope

  • Add one bounded helper that waits for the attempt to leave Pending with a 30 s test budget and the existing message.
  • Replace the three copies.
  • No production change; no change to what the tests assert.

Acceptance

  • The three tests pass repeatedly.
  • The helper still fails within its bound if the attempt stays Pending.
  • No product default changes.

Activity

  1. self-assigned this
    on Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions