Skip to content

fix(ui): hold stream waits in tests and wait for slow work until it answers - #185

Merged
ingvarch merged 1 commit into
mainfrom
fix/playout-slow-work
Nov 4, 2026
Merged

ingvarch merged 1 commit into
mainfrom
fix/playout-slow-work

Conversation

@ingvarch

@ingvarch ingvarch commented Nov 4, 2026

Copy link
Copy Markdown
Owner

What changes

The tests no longer read what a command is still writing. playOut, which runs what a key started the way the program does, told a command that waits on a stream from slow work by time: one that had not answered 100 ms after it started was left running. On a slow runner under the race detector the fake editor took longer, playOut returned, and TestDispatch_WithAPriority read the editor while the command still wrote it (a data race in CI on #179).

  • A command waits on a stream only through waitOn (internal/ui/stream.go), used by the event feed, the log lines and the watch of changes. In the program it waits as before. While playOut runs, a wait answers at once with what has come, or with nothing, the way held timers already do.
  • Every other command is run until it answers. One that takes more than 5 s panics with the name of the command, instead of hanging the run.
  • A guard test keeps every blocking channel receive in internal/ui inside waitOn, like the guard on timers. AGENTS.md rule 3 says so.
  • Nothing waits on time any more, so internal/ui runs faster: about 30 s to 10 s without the race detector.

Production behaviour does not change.

Closes #182

Checklist

  • The test for this change was written first and failed
  • make check is green
  • The title is a conventional commit: feat(ui): ..., fix(nomad): ...

@ingvarch ingvarch added this to the v0.17.0 milestone Nov 4, 2026
@ingvarch ingvarch added bug Something isn't working test Tests only labels Nov 4, 2026
@ingvarch
ingvarch merged commit 4c036d5 into main Nov 4, 2026
5 checks passed
@ingvarch
ingvarch deleted the fix/playout-slow-work branch November 4, 2026 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working test Tests only

Projects

None yet

Development

Successfully merging this pull request may close these issues.

playOut leaves slow work running, and the test reads what it still writes

1 participant