Skip to content

e2e: the F6 scene's strip offset can be undone by a late reveal of the tab in front (ux2-shell.spec.ts, one red under load) #729

Closed

Description

@SSFSKIM

What

e2e/ux2-shell.spec.ts, "Acceptance: overflowing tabs remain reachable and F6 visits cards and surface content", failed once at its poll "the strip is scrolled, short of its end" (line 959 at 3b7493f44): expected 1133, received 1172.5. It passed in every other run of that tree (in e2e:layout, and in e2e:default's second rerun in the whole group's order). The one red was manual gate run 3b7493f443a1-20261116T160258Z, where the scene ran as test 507 of 555 in one worker.

Cause (read in the code; not confirmed from a trace)

The received value is the strip's greatest offset (the scene read an overflow of 1173 and set 1133, 40 px short of the end). So after the scene set the offset, the product scrolled the tab in front (the Diagnostics tab, the strip's last) back into view.

src/renderer/src/main/TabStrip.tsx does that in two places: the effect on the pane's tabs runs measure once and again at every resize of the strip (a ResizeObserver), and measure scrolls the selected tab into view; a second effect does the same when the tab in front changes.

The scene opens "Background tasks" just before, which opens the side column and so narrows the title bar's strip. openSurface returns when the surface is visible. The observer's callback for that resize is delivered at the next frame; the scene's two calls (read the overflow, set the offset) can both run before it. When they do, the callback then scrolls the strip to its end, and the poll, which only reads, never sees the offset again.

The same order is in the scene on master. U6b-1 adds ten kept files and a column at its least width before it, which makes the column's reopening heavier and the frame later; that is the likely reason the first red is on this tree.

Not verified: which of the two (the observer's callback, or the effect's own first measure if the tabs' identity changes with the column) came late; no trace of the red run was read.

Fix (scene only; the product behaves as designed)

The scene settles on the state the reveal leaves, never on time (R2), and then sets the offset:

const widthBefore = await list.evaluate((el) => el.clientWidth); // read before openSurface(page, 'Background tasks')
await openSurface(page, 'Background tasks');
// the column is open and the strip's reveal has run at the narrowed width: the tab in front, the strip's last, is at its end
await expect.poll(() => list.evaluate((el, before) => el.clientWidth < before && el.scrollWidth - el.clientWidth - el.scrollLeft < 1, widthBefore),
  { message: 'the narrowed strip shows the tab in front at its end' }).toBe(true);
const overflow = await list.evaluate((el) => el.scrollWidth - el.clientWidth);
const offset = overflow - 40;
await expect(async () => {
  await list.evaluate((el, to) => { el.scrollLeft = to; }, offset);
  expect(await list.evaluate((el) => el.scrollLeft)).toBe(offset);
}, 'the strip is scrolled, short of its end').toPass();

The first poll waits for the observer's reveal (before it runs, the strip is narrowed but still at the old, smaller offset, so the difference is the column's width). The set and its check are one retried step, so a reveal that still comes late is overridden, and the scene's later polls ("putting the tab in view in front moved nothing") still assert that nothing else moves the strip. If the first poll cannot tell the two states apart on some layout, a data mark written by measure is the other form; it is a product edit and comes back for a ruling.

It goes with the pull request for the load-sensitive cases' bounds.

Acceptance

The scene passes with --repeat-each=5 in e2e:default's whole order on the Mac mini's host, and the steps above carry no wait on time.

Activity

  1. added
    bug
    status:ready-for-implementer
    priority:P3
    on Nov 16, 2026
  2. SSFSKIM commented on Nov 17, 2026

    @SSFSKIM
    OwnerAuthor

    CI-opt's 11-17 flake collection: the identical reading (scrollLeft 1172.5 vs 1133) was the 11-15 e2e:layout red on U1b's fbec1c0 (Actions 43756078524), which was counted then as U1b's own. It is this ticket's flake, not U1b's: it was seen again on U10b-2's 3b7493f (manual gate 3b7493f-20261116T160258Z), which does not hold U1b. Sightings: 2 (11-15, 11-16).

  3. SSFSKIM commented on Nov 19, 2026

    @SSFSKIM
    OwnerAuthor

    Seen again 2026-11-19 on the Mac mini host, now about 3 in 5 instead of one red under load. ux2-shell.spec.ts 'overflowing tabs remain reachable and F6 visits cards and surface content': after the scene sets the strip's scrollLeft to overflow - 40 = 1133, every poll reads 1172.5, the strip's end. The failing repeats took 8 to 10 s and the passing ones about 4 s. --repeat-each 5 gave 3 failed, 2 passed at U6b-5a's 99a2222, and the same 3/2 with the same numbers at bdbfe86 (11-16, before U6b-5a). So it is the base's and not a branch's. Single runs passed at earlier heads with the same code (five on 11-16, one at 7d54d6c this morning). A foreground cut (MAWS_E2E_FOREGROUND=1) is queued to show whether it depends on the window being in front. Raised to P2: it now reds most Mac runs of e2e:layout.

  4. added
    priority:P2
    and removed
    priority:P3
    on Nov 19, 2026
  5. SSFSKIM commented on Nov 19, 2026

    @SSFSKIM
    OwnerAuthor

    Foreground cut at bdbfe86 (plain build, MAWS_HARNESS=0, MAWS_E2E_FOREGROUND=1, --repeat-each 5): 2 failed, 3 passed, the same numbers. It does not answer the question: in every repeat the window never became key ('the first window is not key after 3 s'; Terminal was frontmost). The default lane's own foreground did take the front on the mini today, so the plain build or the spec decides that. Counts today on the mini host: background 3/5 (base), 3/5 + 1/1 (99a2222); foreground requested but not key 2/5 (base). A failing repeat runs about 4 s longer: the 5 s poll runs out. Whoever takes this: the scene's premise (scrollLeft set, then read) races a late reveal of the tab in front, as the title says. Make the scene wait for the strip to settle before setting the offset, or fix the reveal so it never fires after a person or a script has scrolled.

  6. SSFSKIM commented on Nov 20, 2026

    @SSFSKIM
    OwnerAuthor

    Seen again 2026-11-20 on the Mac mini host at U6b-5b's 8e92a86, in e2e:default run whole in the foreground (MAWS_E2E_FOREGROUND), with the same numbers: scrollLeft 1172.5 against 1133, at :964 (in the background groups run of the same head it failed at :973). So being in the foreground doesn't clear it.

  7. SSFSKIM commented on Nov 21, 2026

    @SSFSKIM
    OwnerAuthor

    CI-opt's 2026-11-21 flake collection, the count for 2026-11-20 on the Mac mini's host (manual gate, background unless noted): the F6 scene was red in 5 of the day's 7 whole e2e:default runs, on five different trees, always with the same numbers (scrollLeft 1172.5 against 1133).

    run tree group line, reading
    06f265e-20261120T005810Z U6b-5a 06f265e e2e:default :963, the strip is scrolled, short of its end
    8e92a86-20261120T054220Z U6b-5b 8e92a86 e2e:layout :973, putting the tab in view in front moved nothing
    8e92a86-20261120T060906Z U6b-5b 8e92a86 e2e:default (foreground) :964 (the comment above)
    a3b27b3-20261120T092610Z b7 union a3b27b3 e2e:default :963, short of its end
    808cb0d-20261120T113934Z b7 union 808cb0d e2e:default :964, short of its end
    f530521-20261120T142239Z 733a f530521 e2e:default :964, short of its end

    Green in the whole default runs of 72429dc (022227Z) and 0107c57 (175922Z). So on the host it is no longer one red under load: it fails most whole default runs, and each of those runs is red for it alone or beside the tree's own reds. Logs: ~/.local/share/ci-opt/manual-gate/runs/<run>/mac/mini-run/logs/<group>/job.log on the MacBook.

  8. added
    status:in-progress
    and removed
    status:ready-for-implementer
    on Nov 21, 2026
  9. SSFSKIM commented on Nov 21, 2026

    @SSFSKIM
    OwnerAuthor

    [board] in-progress: Taken by the MAWS architect on CI-opt's count of 2026-11-21 (red in 5 of 7 whole e2e:default runs on the mini's host on 11-20): the scene-only fix of the body, built by a dispatched agent, proved on the mini's host through CI-opt's queue.

  10. removed
    status:in-progress
    on Nov 21, 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

    bugpriority:P2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions