Skip to content

test(tui): fix startup resize race in hidden-frame tests - #4474

Merged
dgageot merged 1 commit into
docker:mainfrom
dgageot:worktree-board-0a38cc0d27d64f6a
Sep 25, 2026
Merged

dgageot merged 1 commit into
docker:mainfrom
dgageot:worktree-board-0a38cc0d27d64f6a

Conversation

@dgageot

@dgageot dgageot commented Sep 25, 2026

Copy link
Copy Markdown
Member

The harness's first View() call was closing the readiness gate before Bubble Tea had a chance to asynchronously deliver the startup WindowSizeMsg. When that resize arrives afterwards, it legitimately clears viewCacheInitialized and recomposes the hidden stream, which raced with the assertions in TestActualProgramHiddenHoverPreservesFollowTail/streaming_before_hover and made the test flaky under load, as seen in https://github.com/docker/docker-agent/actions/runs/36150190157/job/108121238487?pr=4472.

This change makes the test harness wait for the first View() call after the startup window-size message has been processed before signaling readiness, so the recomposition happens deterministically during setup rather than racing with the test body. It's a test-only fix: no production code changes and no added sleeps.

Verified with task build, task test, and task lint, plus targeted repeats of the readiness, hidden-hover, hidden-resize, and hidden-stream-write tests (50x, and 20x with -race -shuffle=on). A Windows build of ./pkg/tui was compiled with GOOS=windows GOARCH=amd64 to check portability, though it wasn't run on native Windows.

Signed-off-by: David Gageot <david.gageot@docker.com>
@dgageot
dgageot requested a review from a team as a code owner September 25, 2026 15:16
@dgageot
dgageot added this pull request to the merge queue Sep 25, 2026
@aheritier aheritier added area/tui For features/issues/fixes related to the TUI status/needs-triage For issues that need to be triaged labels Sep 25, 2026
Merged via the queue into docker:main with commit cf5d144 Sep 25, 2026
15 checks passed
@dgageot
dgageot deleted the worktree-board-0a38cc0d27d64f6a branch September 25, 2026 15:39
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 status/needs-triage For issues that need to be triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants