Repository navigation
Wait for the turn to end after a reply's final text in the E2E tests - #2297
Merged
Merged
Conversation
A reply's last words now show before its turn ends (#2252). Tests that waited only for that text and then read turn-end rows, quit, resumed, pressed a key, or sent the next prompt raced the turn's end. The slower macOS release build loses that race: tui-tool-story read the refused row before its reason showed, and killed fx before the turn was saved. Each such wait now also waits for turnSettled, as d19fe17 did for five waits. The refused-request story holds its stream end for a second after the text, so its row check fails again if runStory stops waiting for the turn's end.
The first sweep covered waitForText only. Tests that found a reply's final text with a scrollback helper, such as waitForScrollback or scrollbackContains, and then read saved state, quit, sent the next prompt, or pressed a key raced the turn's end the same way. On macOS, tui-full-transcript-brutal read the saved log before the live reply was committed and found it missing. Each such wait is now followed by a wait for turnSettled, as sessions already did after one scrollbackContains. The brutal stress test waits for the reply in the saved log instead, since the Ctrl-O viewer can cover the pane's status row.
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.
#2252 made a reply's last words show before its turn ends. Tests that waited only for that text, then read turn-end rows, quit, resumed, pressed a key, or sent the next prompt, now race the turn's end. Linux CI usually wins the race. The macOS arm64 PGSO training build is slower and lost it every time in
tui-tool-story:└ Couldn't run ls, printfbefore· 2 invalid fieldsshowed (the pane still saidGenerating).Each wait like that now also waits for
turnSettled, the form d19fe17 used: 74 waits in 18 files in the PGSO corpus. Waits followed by nothing that depends on the turn's end are unchanged.REFUSED_LASTholds its stream end 1 s after the text, so the refused-row check fails again ifrunStorystops waiting for the turn's end. A held-stream copy of asessions.test.tstest also failed without its fix (turn_interruptedreasons["cancel","cancel"]) and passed with it.Each changed file passes on its own in the sandbox.