Skip to content

Flaky test: File View tabs use the same shrinking strip and transfer the longest title on selection #570

Closed

Description

@yansfil

A local repeat found this test flaky; CI has not reported it yet.

Of the 12 files the test opens by back-to-back double clicks in the Explorer, one never became a tab, and both times it was a CJK name: 项目计划.md once, 検証結果.md once.

First failure:

Error: expect(locator).toHaveCount(expected) failed

Locator:  locator('[data-view-tab-bar] [role=tab]')
Expected: 12
Received: 11
Timeout:  5000ms

Call log:
  - Expect "toHaveCount" locator('[data-view-tab-bar] [role=tab]') with timeout 5000ms
  - waiting for locator('[data-view-tab-bar] [role=tab]')
    14 × locator resolved to 11 elements
       - unexpected value "11"

  185 |     const tabs = page.locator("[data-view-tab-bar] [role=tab]");
  186 |     for (const name of names) await page.locator(`[data-explorer-row="${toPage(root)}/${name}"]`).dblclick();
> 187 |     await expect(tabs).toHaveCount(names.length);

Fix the cause or delete the test by the expiry date; a flaky test is not left running. A longer timeout, more retries or a lower expectation does not end this issue. Each later flaky run adds a comment here.

Activity

  1. added
    bug
    quarantine
    on Oct 5, 2026
  2. yansfil commented on Oct 5, 2026

    @yansfil
    ContributorAuthor

    Cause found; it is a product defect, not the CJK names.

    The Explorer's Git status line sits above the file list and changes after the list is drawn, which moves every row:

    • In a folder that is not a Git repository (this fixture), "Loading Git status" (one line, 25.5 px) becomes "Git status unavailable: ", which wraps to two lines (58.5 px), so every row moves down 33 px.
    • In a Git repository the loading line goes away when the status lands, so every row moves up by one line.

    A double click that lands while the rows move hits the row above the one aimed at, a file already open, so the aimed file never opens.
    The status lands a few hundred milliseconds after the Explorer shows, later under load, which is why the missing file was always the second or third of the twelve opened back to back; the names being CJK is a coincidence of their order.

    Deterministic reproduction (local, 5 of 5): hold the frame carrying the Git answer at the page's socket while the line says loading, measure the row of the second file, release the frame. The row moves from y 179.5 to 212.5, and a double click at the point measured before opens the first file instead of the second.

    Ruled out with evidence: Unicode normalization (the missing names are kanji and hanzi, which NFC and NFD leave unchanged), a layout change of the Explorer column when File Views open (rows keep their box), the page's connection (the reconnecting in the failure context is the page after the test stopped its daemon), the order in which file reads land in the core (every order of three double clicks pins all three), and Explorer rows being re-created (rows keep their DOM nodes across opens).

  3. yansfil commented on Oct 6, 2026

    @yansfil
    ContributorAuthor

    Closing as fixed by #587 (merged 2026-10-06 02:14Z), which replaced the Explorer's Git line with a mark in its root row. No recurrence since; the flaky report reopens this if it comes back.

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

    bugquarantine

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions