Skip to content

Commit

Permalink
Tests: Disable 'stdbuf' when TAP autotime is disabled
Browse files Browse the repository at this point in the history
The 'stdbuf' command is used by default in 'tap-driver.sh' to force line
buffering. It was added to help with TAP autotime output to log files.

However, 'stdbuf' causes issues in our 32-64 integration tests where we
mix 32 and 64 bit binaries. It uses an LD_PRELOAD library that is not
in a multiarch path which results in the following warning message on
stderr when a 32-bit binary is executed on a 64-bit system:

  ERROR: ld.so: object '/usr/libexec/coreutils/libstdbuf.so' from
  LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.

Many of our tests compare the content of stderr to an expected file
which results in their failure.

We already have an environment variable "TAP_AUTOTIME" to disable the
autotime feature, make it disable the use of 'stdbuf' as well.

Change-Id: I307cbfcddd7772f69e8211c51b03fb9a3da8e841
Signed-off-by: Michael Jeanson <[email protected]>
Signed-off-by: Jérémie Galarneau <[email protected]>
  • Loading branch information
mjeanson authored and jgalar committed Feb 29, 2024
1 parent 0107672 commit 2f13f70
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/utils/tap-driver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,11 @@ TIME_SCRIPT="$(realpath -e -- "$(dirname "$0")")/tap/clock"
# the outputs in the resulting file for half written lines, eg.
# ok 93 - Tes# PERROR - xxxx
# t some function
stdbuf -eL -oL -- "$@"
if [ "${TAP_AUTOTIME:-}" != 0 ]; then
stdbuf -eL -oL -- "$@"
else
"$@"
fi
echo $?
) | LC_ALL=C ${AM_TAP_AWK-awk} \
-v me="$me" \
Expand Down

0 comments on commit 2f13f70

Please sign in to comment.