On Fri, May 31, 2024 at 10:43 AM Tom de Vries wrote: > When running test-case gdb.tui/resize-2.exp with taskset -c 0, I sometimes > run > into: > ... > tui disable^[[40;1H^M(gdb) PASS: $exp: tui disable > ^M^[[K(gdb) FAIL: $exp: two prompt redisplays after resize (timeout) > ... > > The test-case does "Term::resize 24 80 0" while having the settings of an > earlier "Term::resize 40 90", so both dimensions change. > > When TUI is enabled, we call Term::resize with wait_for_msg == 1, and the > proc: > - calls stty to change one dimension, > - waits for the message (enabled by "maint set tui-resize-message on") > confirming the resize has happened, > - calls stty to change the other dimension, and again > - waits for the message confirming the resize has happened. > > Since TUI is disabled, we call Term::resize with wait_for_msg == 0 because > the > message is not printed, so stty is called twice, and afterwards we check > for > the results of the two resizes, which is the test that is failing. > > The problem is that not waiting for a response after each stty call opens > up > the possibility of the responses being merged. > > Fix this by calling Term::resize twice, changing one dimension at a time, > and > waiting for a single prompt redisplay after each one. > > Tested on x86_64-linux. > > PR testsuite/31822 > Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31822 > > I think the changes are reasonable. I've tried this on ppc64le, Fedora Rawhide, I haven't run into the described failure even without the patch but I can confirm everything passes including the additional gdb_test_multiple. Reviewed-By: Alexandra Petlanova Hajkova