Skip to content

streaming-remount background-restore test is flaky on macOS #3061

Closed

Description

@Astro-Han

Problem

apps/desktop/e2e/streaming-remount.spec.ts:67 ("returning to a live conversation settles output accumulated while away") fails roughly one run in six on macOS, and only when the whole file runs — the test passes consistently on its own.

The failing assertion is that no intermediate paint shows partially accumulated background output:

expect(backgroundRestoreObserved?.texts.some((text) =>
  text.includes('background output') && !text.includes(backgroundSteering)
)).toBe(false);

The observer watches document.body with subtree: true and samples .maka-bubble-streaming's textContent on every mutation, so its sampling rate depends on how much unrelated DOM churns during the restore. That makes it sensitive to changes elsewhere in the shell, which is a fragile way to assert "no intermediate paint".

Measured before and after #3033's row rebuild: about 1 failure in 7 and 1 in 6 respectively, so the rate is not obviously changed by that work. CI (Linux) has not reproduced it.

Either the intermediate paint is real and rare — in which case the test is finding a genuine bug and should be made deterministic enough to prove it — or the observation method is too coarse. Worth resolving before it gets muted.

Context

Observed while verifying #3033.

Activity

  1. Astro-Han commented on Aug 15, 2026

    @Astro-Han
    ContributorAuthor

    Additional data point, measured today on macOS 15 (Darwin 25.5.0) while working on #3033.

    The failure rate on this machine is currently 3/3 when the file runs, not the ~1-in-6 recorded above. Measured against the branch state with no changes in the working tree, so it is not caused by the rail work; CI's e2e job passed on the same commit, so it stays machine- and load-dependent.

    The passing/failing split is unchanged: --grep "accumulated while away" passes on its own, every time. Only the whole-file run fails, which is consistent with the diagnosis above — the observer samples on every document.body mutation, so what it catches depends on unrelated churn, and a warmer or busier machine changes that.

    Generated-by: Claude Code

  2. added a commit that references this issue on Aug 16, 2026
    84a579d
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

    bugSomething isn't workinghelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions