Skip to content

test(tui): freeze the animation clock in the scrolled-up stream program test - #4289

Merged
dgageot merged 1 commit into
mainfrom
test/tui-scrolledup-frozen-clock
Sep 14, 2026
Merged

dgageot merged 1 commit into
mainfrom
test/tui-scrolledup-frozen-clock

Conversation

@aheritier

Copy link
Copy Markdown
Collaborator

Why

test-race failed on main (run 34831078454):

--- FAIL: TestActualProgramScrolledUpStreamDefersOffscreenTail (15.44s)
    tui_stream_scrolledup_test.go:60: "3" is not less than or equal to "2"

The test drives a real bubbletea program on the wall-clock animation runtime and asserts at most two compositions while an off-screen stream is deferred. Under -race the loop is slow enough (15 s here) for a spinner tick to land inside the window and add a composition. No data race was reported. This is the class of failure #4228 fixed for the other exact-count program tests by moving them to frozenClockRoot; this test was not covered.

What

wallClockRootfrozenClockRoot, as in #4228. The test still exercises the real program loop; only the animation clock stops advancing.

Locally: go test -race -count=3 -run TestActualProgramScrolledUpStreamDefersOffscreenTail ./pkg/tui/ passes. The failure did not reproduce locally on the wall clock in 6 runs (4 s each vs 15 s in CI), consistent with a CI-speed-dependent tick.

…am test

Under -race the real program loop is slow enough for a spinner tick to
land inside the measured window and add a third composition to the "at
most two" assertion (main run 34831078454). Same fix as #4228 for the
other exact-count program tests: build the root on the frozen scheduler.
@aheritier
aheritier requested a review from a team as a code owner September 14, 2026 15:17
@dgageot
dgageot added this pull request to the merge queue Sep 14, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 14, 2026
@aheritier aheritier added area/tui For features/issues/fixes related to the TUI kind/test Test-only changes labels Sep 14, 2026
@dgageot
dgageot added this pull request to the merge queue Sep 14, 2026
Merged via the queue into main with commit 82cb58a Sep 14, 2026
17 checks passed
@dgageot
dgageot deleted the test/tui-scrolledup-frozen-clock branch September 14, 2026 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/tui For features/issues/fixes related to the TUI kind/test Test-only changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants