On 15/03/2023 16:34, Pádraig Brady wrote:
On 15/03/2023 15:25, Bruno Haible wrote:
Pádraig Brady wrote:
It would be good to get output from
make TESTS=tests/misc/tee.sh VERBOSE=yes SUBDIRS=. check
to get more info on the tee one,

Attached here.

I'd need access to debug further I think.
The new iopoll-powered early exit for closed pipes in tee is failing.
It's a bit surprising that the tail-2/pipe-f.sh test is passing
and that uses essentially the same logic on the output.
So if I had to guess, the input side of the new iopoll()
logic is failing on AIX for some reason.

I got access to AIX on the compile farm,
and confirmed there that tail-2/pipe-f.sh does infact fail for me.
So that's consistent with the misc/tee.sh failure at least.
Also I confirmed that the older tail code before the iopoll refactoring also 
fails.
In fact I can't determine a way (with poll or select) to detect closed output 
on AIX.
So the attached avoids testing that functionality on AIX.

cheers,
Pádraig
From 276bf9ec86baad9ce873647b2a4ed3708083fe80 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <p...@draigbrady.com>
Date: Fri, 17 Mar 2023 19:57:18 +0000
Subject: [PATCH] tests: aix: avoid unsupported functionality

* tests/misc/tee.sh: AIX doesn't support detecting
closed outputs either with poll() or select() so avoid
testing that functionality.
* tests/tail-2/pipe-f.sh: Likewise.
---
 tests/misc/tee.sh      | 6 +++++-
 tests/tail-2/pipe-f.sh | 6 +++++-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/tests/misc/tee.sh b/tests/misc/tee.sh
index ce0cfd41d..e01c27ecc 100755
--- a/tests/misc/tee.sh
+++ b/tests/misc/tee.sh
@@ -63,6 +63,9 @@ if test -w /dev/full && test -c /dev/full; then
   test $(wc -l < err) = 1 || { cat err; fail=1; }
 fi
 
+case $host_triplet in
+  *aix*) echo  'avoiding due to no way to detect closed outputs on AIX' ;;
+  *)
 # Test iopoll-powered early exit for closed pipes
 tee_exited() { sleep $1; test -f tee.exited; }
 # Currently this functionality is most useful with
@@ -72,7 +75,8 @@ tee_exited() { sleep $1; test -f tee.exited; }
 retry_delay_ tee_exited .1 7 | # 12.7s (Must be > following timeout)
 { timeout 10 tee -p 2>err && touch tee.exited; } | :
 test $(wc -l < err) = 0 || { cat err; fail=1; }
-test -f tee.exited || fail=1
+test -f tee.exited || fail=1 ;;
+esac
 
 # Test with unwriteable files
 touch file.ro || framework_failure_
diff --git a/tests/tail-2/pipe-f.sh b/tests/tail-2/pipe-f.sh
index 61812d1aa..46bcbbeae 100755
--- a/tests/tail-2/pipe-f.sh
+++ b/tests/tail-2/pipe-f.sh
@@ -41,6 +41,9 @@ compare exp out || fail=1
 # Also check tail exits if SIGPIPE is being ignored.
 # Note 'trap - SIGPIPE' is ineffective if the initiating shell
 # has ignored SIGPIPE, but that's not the normal case.
+case $host_triplet in
+  *aix*) echo  'avoiding due to no way to detect closed outputs on AIX' ;;
+  *)
 for disposition in '' '-'; do
   (trap "$disposition" PIPE;
    returns_ 124 timeout 10 \
@@ -49,7 +52,8 @@ for disposition in '' '-'; do
   test -e timed_out && fail=1
   compare exp out2 || fail=1
   rm -f timed_out
-done
+done ;;
+esac
 
 # This would wait indefinitely before v8.28 (until first write)
 # test -w /dev/stdout is used to check that >&- is effective
-- 
2.26.2

Reply via email to