Commit 9bbd6d585a for openssl.org
commit 9bbd6d585a164d2272bf7b354e80fb03bd5fccd7
Author: Mounir IDRASSI <mounir.idrassi@idrix.fr>
Date: Fri Aug 14 15:00:59 2026 +0900
test: keep QUIC RADIX diagnostics out of TAP pipe
quic_radix_test emits several MiB of diagnostics on stderr even when
it succeeds. In #32128 the process was observed blocked in fwrite()
while writing this output to its inherited stderr pipe.
As a targeted workaround, redirect stderr to a log during non-verbose
harness runs. If the test fails, replay diagnostics from at most the
final 32 KiB and report the log path. This preserves useful failure
context without feeding the full multi-megabyte log back through the
TAP pipe. Verbose and direct recipe runs remain unchanged.
This removes the observed writer-side backpressure point without
changing general harness behavior. The reason the harness reader
stopped making progress remains unknown.
Related to #32128
Assisted-by: Codex:gpt-5.6-sel
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Saša NedvÄ›dický <sashan@openssl.org>
MergeDate: Mon Aug 17 20:19:49 2026
(Merged from https://github.com/openssl/openssl/pull/32395)
diff --git a/test/recipes/70-test_quic_radix.t b/test/recipes/70-test_quic_radix.t
index f32d2f6920..9250a2b0df 100644
--- a/test/recipes/70-test_quic_radix.t
+++ b/test/recipes/70-test_quic_radix.t
@@ -1,14 +1,50 @@
#! /usr/bin/env perl
-# Copyright 2024-2025 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2024-2026 The OpenSSL Project Authors. All Rights Reserved.
#
# Licensed under the Apache License 2.0 (the "License"). You may not use
# this file except in compliance with the License. You can obtain a copy
# in the file LICENSE in the source distribution or at
# https://www.openssl.org/source/license.html
-use OpenSSL::Test qw/:DEFAULT srctop_file/;
+use OpenSSL::Test qw/:DEFAULT result_file srctop_file/;
use OpenSSL::Test::Utils;
+sub diagnose_failure {
+ my ($log, $max_bytes) = @_;
+ my $fh;
+
+ diag("Full stderr: $log");
+ if (!open($fh, "<", $log)) {
+ diag("Could not open stderr log: $!");
+ return;
+ }
+
+ binmode($fh);
+ my $size = -s $fh;
+ if (!defined($size)) {
+ diag("Could not determine stderr log size: $!");
+ close($fh);
+ return;
+ }
+
+ my $offset = $size > $max_bytes ? $size - $max_bytes : 0;
+ if (!seek($fh, $offset, 0)) {
+ diag("Could not seek in stderr log: $!");
+ close($fh);
+ return;
+ }
+
+ # Do not start the diagnostic output with a truncated line.
+ scalar <$fh> if $offset > 0;
+
+ diag("Stderr tail (up to " . ($max_bytes / 1024) . " KiB):");
+ while (my $line = <$fh>) {
+ $line =~ s/\r?\n\z//;
+ diag($line);
+ }
+ close($fh);
+}
+
setup("test_quic_radix");
plan skip_all => "QUIC protocol is not supported by this OpenSSL build"
@@ -16,6 +52,13 @@ plan skip_all => "QUIC protocol is not supported by this OpenSSL build"
plan tests => 1;
-ok(run(test(["quic_radix_test",
- srctop_file("test", "certs", "servercert.pem"),
- srctop_file("test", "certs", "serverkey.pem")])));
+# Keep the test's multi-megabyte diagnostics out of the TAP pipe.
+my $redirect = $ENV{HARNESS_ACTIVE} && !$ENV{HARNESS_VERBOSE};
+my $stderr_log = result_file("quic_radix_test.log");
+my $result = run(test(["quic_radix_test",
+ srctop_file("test", "certs", "servercert.pem"),
+ srctop_file("test", "certs", "serverkey.pem")],
+ $redirect ? (stderr => $stderr_log) : ()));
+
+diagnose_failure($stderr_log, 32 * 1024) if !$result && $redirect;
+ok($result, "running QUIC RADIX tests");