Skip to content

test_a_key_typed_through_the_reload_acts_where_the_user_is_put_back: Firefox key typed through a reload resolves nothing under load #7143

Done

Description

@leaf-agent

tests/browser/startup/test_readiness.py::test_a_key_typed_through_the_reload_acts_where_the_user_is_put_back[firefox_browser] fails under load: the r pressed while the tab reloads resolves no thread.

Failed: the key typed through the reload resolved no thread; last reading was []

It first failed on main in run 45554671416 at 5fc5f86. It passed in the five push runs before that one. The commits in that range didn't introduce it, because it reproduces before them:

commit leaf-dev suite flake --copies 24 --workers 4 --load 3
a1ac633 (before the failing range) 2 of 24 failed
ceec054 (current main) 1 of 24 failed (0 of 12 at --load 2)

Chromium passes. The diagnosis is still open. The test presses r once document.readyState !== 'loading', while it holds the new document's /api/state answers. The key is meant to land in the thread view that the entry's record puts the user back in (keyboard/bindings.js, placeHandedBack). In a failing copy the key leaves no resolve event. That means the key is lost or dropped before the view it should act in exists. If so, the user's keypress is dropped, which is a product defect and not a test-ordering issue. The next step is to record, in a failing copy, where Firefox delivered the keydown (the target and whether the handler saw it) relative to the view's opening.

Cause of a failure tracked in #7136.

Activity

  1. added
    tend-ci-cause
    on Nov 25, 2026
  2. leaf-agent commented on Nov 25, 2026

    @leaf-agent
    CollaboratorAuthor

    The key was never lost in Leaf: in Firefox the test pressed before the reloaded document could receive keys. #7151 fixes the test, and its CI and landing are with tend-land.

    In each failing copy I logged every window input event in the new document. The press started at 7965 ms, but the window's focus event came at 8052 ms, and the window saw only the stray keyup at 8118 ms. In another failure nothing of the key arrived at all. No keydown reached any Leaf listener, so the early key hold had nothing to hold. document.hasFocus() alone isn't a reliable gate, because it already reads true while Firefox's focus event is still pending (1 of 48 copies still failed). So the test now waits for that event in Firefox and for hasFocus() in Chromium, which fires none on reload.

    Under leaf-dev suite flake --workers 4 --load 3, the Firefox node failed 2 of 24 copies in each of two runs before the change and passed 54 of 54 after it. Chromium passed 12 of 12.

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

    tend-ci-cause

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions