Repository navigation
Tests: live tests wait for NMSh's journal, not screen text (CI races seen on #441 and #442) - #442
Merged
Merged
Conversation
The wait matched the queued command's text in the queue list before its output or prompt, so cat could be typed while that command was still finishing. NMSh then queues cat by design and never draws Running cat (the CI failure on #441). The output now differs from the command text, and the test waits for the queued command's completion row, which is drawn only once the shell's prompt has returned.
…ommand ran typingAfterRead waited for NEXT-<tag> followed by Completed: the queued command's row and an older redrawn Completed matched before the read printed its answer (macOS CI on #442; reproduced on dev with a read whose output comes 1 s late). The live Frontend now exposes the journal count run() already uses; typingAfterRead and commandQueueLive wait for the command's completed record, which the frontend writes once the shell's prompt returns.
raiseCatError
added a commit
that referenced
this pull request
Oct 19, 2026
…source findings The candidate (all nine PRs in dependency order) is green in CI on 567cf53 after two #437 follow-ups it surfaced. Records #442 and #443, the stacked #437, the conflict rule, the scratch combined /view editor test, what was recovered after the 2026-10-19 kernel panic, and the findings for the planned test-resource pass.
…un once With #437's #426 review change, a command typed ahead during a hidden read's answer can be held at the prompt when a look still saw hidden input as the command ended (it may be a reply to a second question with no prompt). It is then never run by itself; the person's Tab shows it and Enter runs it. The test accepts that outcome only for typing ahead during a hidden read, presses Tab and Enter, and still requires the next command to run exactly once (journal count). Without #437 the held branch is never taken.
Owner
Author
|
Release follow-up, |
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.
The failure
Ubuntu,
tests/commandQueueLive.test.ts, a program waiting for a line gets Enter; Ctrl+Q queues; Ctrl+S sends to a program NMSh cannot see waiting:timed out waiting for /Running cat/, with the screen showing◆ Waiting for input · cat.Cause (reproduced on
deva8b383c2and on #441's head)The test queues
echo QUEUED-AFTER-READwith Ctrl+Q whilereadwaits, answersalice, waits for/got=alice[\s\S]*QUEUED-AFTER-READ/, then typescat.That wait can match the queue list's row
echo QUEUED-AFTER-READ, drawn undergot=alice, before the command's output and before its prompt returns. Measured frame by frame on the unchanged test sequence (first read in a fresh session):from queuecompletion)deva8b383c248f70e96, busier machineSo
catcan be typed while the queued command is still finishing.catby design (Enter while a command runs queues), and runs it from the queue. While the queue timeline shows, the activity row is the queue summary (Queue activity · … · 1 running), notRunning cat.◆ Waiting for input · cat, exactly the CI screen.devand Composer history: History n/N on a free composer rule while browsing (#389) #441, showingcatin the queue timeline.Neither #438 nor #441 touches this path (the test never presses Up).
A second race of the same class (macOS CI on this PR, run 39178446961)
tests/typingAfterRead.test.ts, live zsh: keys typed the moment a read finishes are never lost, nor keys typed ahead during it, failed withthe answer reached read, expectedgot=vahead2.echo NEXT-<tag>at once (it is queued), and waits forNEXT-<tag>[\s\S]*Completed. That can match the queue row› echo NEXT-<tag>followed by an olderCompletedin a later redraw. The CI screen shows the read still running (1 running · 1 waiting) when the assertion ran.dev, 6 rounds: the regex matched at 112–443 ms, and NMSh's journal recordedecho NEXT-<tag>completed at 534–1017 ms, every time. On this Mac the answer happened to be drawn first; on the CI runner it was not.dev: with the read's output 1 s late, the unchanged test fails with the CI message (expected /got=vahead1/).Fix (test only, both races)
tests/helpers/liveFrontend.ts:Frontend.completions(command)exposes the journal countrun()already used. The frontend writes that record when the shell's prompt returns, so waiting for it to grow is a deterministic end of a command, independent of screen text.commandQueueLive: the queued command isprintf "QUEUED-%s\n" AFTER-READ, so its output cannot match its command text. After its output, the test waits for its journal record before typingcatat an idle prompt.typingAfterRead: the test waits for the journal record ofecho NEXT-<tag>, then asserts the answer reached the read. It now also asserts that the next command's output (not its text) appeared, which is stricter than before.No sleep, no longer timeout, no retry; no assertion is weakened.
Verification
dev)commandQueueLive, queued command's prompt 1 s after its outputdevand #441)typingAfterReadzsh, read output 1 s latetests/commandQueueLive.test.tstests/typingAfterRead.test.ts(zsh, Bash, Fish)Not caused by this PR, not fixed here
Ubuntu, same CI run: live fish: absolute executable paths… timed out waiting for
ADB[devices].Residual (not changed here)
On Linux,
Running catis drawn only before the first input look (400 ms after the command starts), after which the kernel's report showsWaiting for input · cat. A frontend that draws nothing for 400 ms aftercatstarts would miss it. That has not been observed, and this CI failure is fully explained by the queue race above.Refs #431