Skip to content

Console e2e: the leases page is usable with the keyboard alone fails intermittently #929

Closed

Description

@V3RON

e2e/console/leases.spec.ts:653 ('the leases page is usable with the keyboard alone', under the leases page describe) was seen failing on CI during the review of PRs #889-#895. The failing assertion and the CI run were not kept, so the report has no log yet.

The triage has to find the failure first: search recent failed Console jobs on CI for this test, then reproduce it locally (pnpm exec playwright test --project=chromium e2e/console/leases.spec.ts -g 'keyboard alone', in a loop). If no failure can be found or reproduced, say so and move this to bug:needs-info.

Written by an agent.

Activity

  1. added
    flaky-testNames a test that fails without a code change. Delivery skips its base-commit check.
    on Oct 23, 2026
  2. self-assigned this
    on Oct 23, 2026
  3. V3RON commented on Oct 23, 2026

    @V3RON
    ContributorAuthor

    Reproduction

    This is a defect in the test, not in the console. The test presses Tab and types the token while the "Signing in…" screen is still up, so the token never reaches the form. It failed this way once on CI (run 39807989162, job 119926832063, security/uplink-worker-pin, 2026-10-22). On origin/main (f6cc13c) it failed 1 time in 60 local runs, on the same line.

    bug/929-repro (57baa30) changes only the test: it holds the first /v1/identity for 1 s, which makes the test lose the race every time (5 of 5 runs).

    pnpm build:e2e && pnpm exec playwright test --project=chromium e2e/console/leases.spec.ts -g 'keyboard alone'
    
    Error: expect(locator).toBeVisible() failed
    Locator: getByRole('heading', { name: 'Overview', level: 1 })
    Error: element(s) not found
    > 684 |       await expect(page.getByRole("heading", { level: 1, name: "Overview" })).toBeVisible();
    

    Trace of the local failure, with times relative to the end of goto. The page snapshot at the failure shows the sign-in form with an empty token field.

    +0 ms        goto ends   snapshot: "Signing in…"
    +34 ms       Tab
    +40–68 ms    type token  (/v1/identity 401 answers at about +60 ms; the form shows during the typing)
    +70 ms       Enter       -> no submit; Overview never shows
    

    Root cause

    e2e/console/leases.spec.ts:669-672 (on main) presses Tab as soon as goto resolves. goto waits for load, not for the identity check. Until that check answers, ui/src/app/app.tsx:36-37 renders SigningInScreen, which has no focusable control. So the Tab does nothing, the typed characters go to <body>, and Enter submits nothing. The symptom shows two lines later, at :673. The console does the right thing here: a person waits until the form is there.

    Simplest fix

    Wait for the form and check the focus before typing, as shell.spec.ts:61-64 does. This made the reproduction pass 10 of 10 times with the check still held.

    await page.goto(host.url);
    await expect(page.getByLabel("Operator token")).toBeEditable();
    await page.keyboard.press(tab);
    await expect(page.getByLabel("Operator token")).toBeFocused();

    Keep the held /v1/identity route so the test keeps covering the slow case.

    Alternatives rejected

    • page.goto(..., { waitUntil: "networkidle" }): Playwright discourages it, and it does not wait for React to render.
    • Autofocus the token field in the UI: it changes the product to work around a test race.
    • Retries: they hide the race without fixing it (testing rule 5).

    Risk

    • The webkit project uses Alt+Tab. Check that the first Tab still focuses the field there.

    Side findings

    Written by an agent.

  4. removed their assignment
    on Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    flaky-testNames a test that fails without a code change. Delivery skips its base-commit check.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions