On Fri, Mar 03, 2023 at 10:45:40AM +0000, Daniel P. Berrangé wrote:
On Fri, Mar 03, 2023 at 09:30:39AM +0100, Thomas Huth wrote:
On 02/03/2023 19.46, Daniel P. Berrangé wrote:
3) When I tried this last year, I had a weird problem that
the terminal sometimes gets messed up ... I wasn't able
to track it down back then - could you check by running
"make check-block" many times (>10 times) to see whether
it happens with your series or not?
I've just seen this - echo got disabled on my terminal.
The problem is that testrunner.py script doing
# We want to save current tty settings during test run,
# since an aborting qemu call may leave things screwed up.
@contextmanager
def savetty() -> Iterator[None]:
isterm = sys.stdin.isatty()
if isterm:
fd = sys.stdin.fileno()
attr = termios.tcgetattr(fd)
try:
yield
finally:
if isterm:
termios.tcsetattr(fd, termios.TCSADRAIN, attr)
When invoking 'check' this wraps around execution of the entire
'check' script. IOW it saves/restores the terminal once.
When we invoke 'check' in parallel it will save/restore the same
terminal for each invokation.
If the 'termios.tcgetattr' call runs at the same time as there is
a QEMU running which has put the terminal in raw mode, then when
'check' exits it'll "restore" the terminal to raw mode.
IOW, this savetty() logic is fundamentally unsafe when invoking
'check' in parallel.