]> git.kaiwu.me - haproxy.git/commitdiff
REGTESTS: decompression: don't use yes(1) in http_large_cl
authorOlivier Houchard <ohouchard@haproxy.com>
Tue, 17 Nov 2026 16:37:14 +0000 (17:37 +0100)
committerOlivier Houchard <cognet@ci0.org>
Tue, 17 Nov 2026 16:23:04 +0000 (17:23 +0100)
The body of http_large_cl.vtc was produced using "yes | head -c". But
vtest ignores SIGPIPE, which is inherited by the shell commands, and
BusyBox's yes never stops when its output is closed in this case. The test
then hangs until it is killed by vtest, as seen on the Alpine CI. GNU yes
is not affected because it exits on the write error.

Let's use awk instead to produce the same 24000 bytes. This test was added
by commit 68a8abcbe ("REGTESTS: decompression: test a large decompressed
Content-Length response"), no backport is needed.

reg-tests/decompression/http_large_cl.vtc

index 44814f4758ee51dbad80ac2099096b4f7e46d1bb..55d250e052c4d470de1565b13cb873bb874fc42b 100644 (file)
@@ -9,7 +9,7 @@ feature ignore_unknown_macro
 # message, but it decompresses into more than a buffer. The end of message
 # must only be reported once all the decompressed data were emitted.
 shell {
-    yes "decompressed by haproxy" | head -c 24000 | gzip -c > ${tmpdir}/big.gz
+    awk 'BEGIN { for (i = 0; i < 1000; i++) print "decompressed by haproxy" }' | gzip -c > ${tmpdir}/big.gz
 }
 
 server s1 {