]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
test/recipes/90-test_memfail.t: disable mfail before doing count runs
authorEugene Syromiatnikov <esyr@openssl.org>
Mon, 27 Apr 2026 08:17:34 +0000 (10:17 +0200)
committerNikola Pajkovsky <nikolap@openssl.org>
Thu, 30 Apr 2026 06:58:48 +0000 (06:58 +0000)
mfail allocator hooks installation affect memory allocation counts,
so it should be disabled for both "count" and "run" test calls.

Fixes: 3cff7c218179 "Add memory allocation failure testing framework"
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.foundation>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
MergeDate: Thu Apr 30 06:59:06 2026
(Merged from https://github.com/openssl/openssl/pull/30991)

test/recipes/90-test_memfail.t

index 8ca6b85c55043459b0ccb7a579551b3f2e5f6273..e4a8a0d47af7e17aa44cfd50194685864334e943 100644 (file)
@@ -26,6 +26,9 @@ plan skip_all => "$test_name requires allocfail-tests to be enabled"
 # and parse that to figure out what our values are
 #
 my $resultdir = result_dir();
+
+$ENV{OPENSSL_TEST_MFAIL_DISABLE} = "1";
+
 run(test(["handshake-memfail", "count", srctop_dir("test", "certs")], stderr => "$resultdir/hscountinfo.txt"));
 
 run(test(["x509-memfail", "count", srctop_file("test", "certs", "servercert.pem")], stderr => "$resultdir/x509countinfo.txt"));
@@ -73,8 +76,6 @@ plan skip_all => "could not get malloc counts (one or more count runs failed or
 #
 plan tests => $total_malloccount;
 
-$ENV{OPENSSL_TEST_MFAIL_DISABLE} = "1";
-
 sub run_memfail_test {
     my $skipcount = $_[0];
     my @mallocseq = (1..$_[1]);