On 23/01/2026 17:46, Bruno Haible wrote:
Pádraig Brady wrote:
On Solaris 11.4, there are two test failures:

FAIL: tests/stty/stty-row-col

+ stty rows 0x1E
+ stty size
+ test 'x34 80' = 'x30 80'
+ fail=1

That's a strange error. Also I can't repro on cfarm215.cfarm.net (solaris 11.4)
Where are you running this?

I'm running this in a VM, created from the "x86 Text Installer" that I got from
https://www.oracle.com/technetwork/server-storage/solaris11/downloads/install-2245079.html

I see this in the console (no X11 running):
$ src/stty size
34 80
$ echo $LINES
34
$ echo $COLUMNS
80
This console is not resizable. It's always 34x80 cells large.

Interesting. So it fell back to the default somehow.
Perhaps something triggered a "resize" event.
It does look like an async issue, since only a single instance
of `stty rows 30` was impacted.

The attached fixes the false fail when resizing virtual terminals at least.

thanks,
Padraig.
From 952b0549e06c5d4cb30b96784e0b725a4b39137f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <[email protected]>
Date: Fri, 23 Jan 2026 18:24:53 +0000
Subject: [PATCH] tests: stty: avoid false failure if resizing terminal

* tests/stty/stty-row-col.sh: Skip the test if we detect terminal
resizing.  Also more robustly restore the original size.
---
 tests/stty/stty-row-col.sh | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/tests/stty/stty-row-col.sh b/tests/stty/stty-row-col.sh
index d751db8ff..4229c28bb 100755
--- a/tests/stty/stty-row-col.sh
+++ b/tests/stty/stty-row-col.sh
@@ -58,6 +58,15 @@ set -- $tests
 saved_size=$(stty size) && test -n "$saved_size" \
   || skip_ "can't get window size"
 
+cleanup_()
+{
+  trap - WINCH
+  if test -n "$saved_size" && test "x$saved_size" != "x0 0"; then
+    set x $saved_size
+    stty rows $2 columns $3
+  fi
+}
+
 # Linux virtual consoles issue an error if you
 # try to increase their size.  So skip in that case.
 if test "x$saved_size" != "x0 0"; then
@@ -78,14 +87,14 @@ while :; do
     # echo "testing \$(stty $args; stty size\) = $expected_result ..."
     echo "test $test_name... " | tr -d '\n'
   fi
+  trap '' WINCH # Ignore terminal resizes
   stty $args || exit 1
+  # Skip if other terminal resizes detected
+  trap 'skip_ "terminal resize detected"' WINCH
   test x"$(stty size 2> /dev/null)" = "x$expected_result" \
     && ok=ok || ok=FAIL fail=1
   test "$VERBOSE" = yes && echo $ok
   shift; shift; shift
 done
 
-set x $saved_size
-stty rows $2 columns $3 || exit 1
-
 Exit $fail
-- 
2.52.0

Reply via email to