hal: Gate the loadusr "Waiting for component" pacifier on a tty - #4290
Open
grandixximo wants to merge 1 commit into
Open
hal: Gate the loadusr "Waiting for component" pacifier on a tty#4290grandixximo wants to merge 1 commit into
grandixximo wants to merge 1 commit into
Conversation
On a slow or busy machine, loadusr -W/-Wn prints "Waiting for component '...' to become ready..." to stderr after two seconds. That message is meant for an interactive user, but in batch use (scripts, the test suite) it is noise. Worse: Ubuntu's xvfb-run merges the wrapped command's stderr into its stdout, so on a loaded ubuntu CI runner the pacifier lands in a test's captured output and breaks the compare against the expected file. Only print the pacifier when stderr is a terminal, in both halcmd and halrmt. Also fix halcmd printing the terminating newline from count >= 100 even though the pacifier itself only starts at count == 200. Fixes LinuxCNC#4287
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.
Fixes #4287.
Problem
The pyvcp test (and any test comparing captured output) flakes on slow or busy CI:
The "Waiting for component..." pacifier is printed by halcmd's
loadusr -Wnto stderr after 2 s of waiting. It lands in the test'sresultfile anyway because Ubuntu 24.04'sxvfb-runexecutes the wrapped command with"$@" 2>&1, merging stderr into stdout (Debian's and upstream xorg's xvfb-run keep the streams separate). On a loaded ubuntu CI runner, pyvcp takes >2 s to become ready, the pacifier fires, and the merged output breaks the compare againstexpected. Thesed '/mypanel/!d'in the test keeps the line because it contains the component name.I reproduced this byte-identically on a Debian host by extracting Ubuntu noble's
xvfb-run(xvfb_21.1.12-1ubuntu1.8_amd64.deb), delaying pyvcp startup with asleepwrapper, and saturating the CPU.Fix
The pacifier is a progress indication for an interactive user; in batch use it is pure noise. Only print it when stderr is a terminal, in both halcmd and halrmt. The
warn_newly_loaded_compsdiagnostic (wrong-Wnname hint) is unaffected and still prints.Also fixes halcmd printing the terminating newline from
count >= 100even though the pacifier itself only starts atcount == 200.Testing