From f5aa0fadea4c11b4fea988832ac706a96b58e0fa Mon Sep 17 00:00:00 2001 From: Bernd Edlinger Date: Fri, 10 Jan 2025 19:58:46 +0100 Subject: [PATCH] Fix test failure in 30-test_evp_pkey_provided.t MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit In this test there is a random test output corruption. `make test TESTS=test_evp_pkey_provided V=1` has some random output, that can with a certain probability start a line with "ok" or so: # Setting up a OSSL_ENCODER context with passphrase # Testing with no encryption jLixONcRPi/m64CGie4KKKDuGeTjtYwfima3BNYCGlgbLGeK3yYxBfZb9JjviOJ4 # nHaNsRsONTAKyg== This happens because large random data is output to bio_out but some data remains buffered, and then test_note() is used to print some comments on the bio_err file. This causes output corruption that confuses the TAP parser. Fix that by flushing any pending output with test_flush_stdout() first. Fixes #23992 Reviewed-by: Saša Nedvědický Reviewed-by: Paul Dale Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/26383) (cherry picked from commit c37f564bb8e25f825ff722642aaf735e8d74abb4) --- test/testutil/tests.c | 1 + 1 file changed, 1 insertion(+) diff --git a/test/testutil/tests.c b/test/testutil/tests.c index 32bf2b2b935..32014c489de 100644 --- a/test/testutil/tests.c +++ b/test/testutil/tests.c @@ -145,6 +145,7 @@ void test_perror(const char *s) void test_note(const char *fmt, ...) { + test_flush_stdout(); if (fmt != NULL) { va_list ap; -- 2.47.2