Skip to content

test: wait for the event in tests that raced the main actor or a timer - #3253

Merged
datlechin merged 1 commit into
mainfrom
test/ssh-prompt-dismissal-race
Oct 3, 2026
Merged

datlechin merged 1 commit into
mainfrom
test/ssh-prompt-dismissal-race

Conversation

@datlechin

Copy link
Copy Markdown
Member

Why

The Unit tests job on main fails on SSHTunnelErrorTests.cancellationDismissesPrompt, on the push for #3251 and again on its re-run. The prompt dismissal is a main-actor job. The test ran off the main actor and waited with 20 Task.yield() calls, which never wait for the main thread, so the assertion could run first.

Change

  • The SSH test waits for the dismissal itself through BoundedCall, so it neither fails early nor hangs.
  • Two sidebar filter tests slept 300 ms against the 150 ms debounce and then asserted. They now wait for the value the debounce publishes.

Verified

A probe of the old SSH wait reads false in 20 of 20 runs; the event wait is right in 20 of 20 and returns at its bound when the event never comes. SSHTunnelErrorTests and SidebarViewModelSearchDebounceTests pass locally.

Not in this PR

  • The other 57 Task.yield() sites in TableProTests were audited: each waits on the main actor for a job already queued there, which holds.

SSHTunnelErrorTests.cancellationDismissesPrompt waited for a main-actor job with 20 Task.yield() calls off the main actor, which never wait for the main thread. It fails the Unit tests job on main. It now waits for the dismissal itself, bounded by BoundedCall.

Two sidebar filter tests slept 300 ms against the 150 ms debounce. They now wait for the value the debounce publishes.
@datlechin
datlechin merged commit 2e6c32d into main Oct 3, 2026
15 checks passed
@datlechin
datlechin deleted the test/ssh-prompt-dismissal-race branch October 3, 2026 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant