Repository navigation
fix(ui): hold stream waits in tests and wait for slow work until it answers - #185
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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,playOutreturned, andTestDispatch_WithAPriorityread the editor while the command still wrote it (a data race in CI on #179).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. WhileplayOutruns, a wait answers at once with what has come, or with nothing, the way held timers already do.internal/uiinsidewaitOn, like the guard on timers. AGENTS.md rule 3 says so.internal/uiruns faster: about 30 s to 10 s without the race detector.Production behaviour does not change.
Closes #182
Checklist
make checkis greenfeat(ui): ...,fix(nomad): ...