Skip to content

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

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

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