Skip to content

Flaky test: UpdateTab.test.jsx reconcile flow intermittently fails ('Restarting...' button not found) #2065

Description

@atomantic

The UpdateTab reconcile flow tests in client/src/components/apps/tabs/UpdateTab.test.jsx are timing-flaky and intermittently fail CI with:

TestingLibraryElementError: Unable to find role="button" and name "Restarting..."

Observed failing on both cases in the reconcile flow describe block:

  • "arms the restart-polling fallback once a disconnect is confirmed by an unreachable health check"
  • "still confirms a real disconnect under StrictMode (mountedRef survives the dev-mode phantom mount→cleanup→remount)"

Evidence it is flaky (not a regression): reproduces on a clean origin/main (commit 2e3073bcf) roughly 1 run in 7 in isolation, passes 5/5 the next batch. Blocked PR #2061 on two consecutive CI runs, then passed green on a third re-run with no code change. None of the recently merged PRs touch UpdateTab.

Likely cause: the test races on the transient "Restarting..." button state during the async health-check reconcile — the button is asserted before/after the reconcile effect resolves under React StrictMode double-mount. Fix by awaiting the transient state via findByRole with an appropriate timeout, or by driving the fake timers/health-check mock deterministically instead of relying on real microtask ordering.

Location: client/src/components/apps/tabs/UpdateTab.test.jsxUpdateTab reconcile flow.

Metadata

Metadata

Assignees

Labels

planTracked by /do:replan

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions