From 6d54faf9f5fa2e0712a4a59d9081b50ea44e2431 Mon Sep 17 00:00:00 2001 From: Martijn Dekker Date: Mon, 3 May 2021 16:55:42 +0100 Subject: [PATCH] tests/leaks.sh: fix intermittent fails on Gentoo (re: 005d38f41) This applies when ksh is compiled with standard malloc. Apparently, 1024 iterations is not enough on Gentoo Linux i386, at least not when running the full test suite. The leak tests fail intermittently and different tests fail each time, but always with a leak of exactly 36864 bytes for each failing test. So those failures are clearly spurious. Doubling the number of iterations seems to make them go away. --- src/cmd/ksh93/tests/leaks.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/ksh93/tests/leaks.sh b/src/cmd/ksh93/tests/leaks.sh index 638157386..0f50da2da 100755 --- a/src/cmd/ksh93/tests/leaks.sh +++ b/src/cmd/ksh93/tests/leaks.sh @@ -35,7 +35,7 @@ then N=512 # number of iterations for each test } # On Linux, we can use /proc to get byte granularity for vsize (field 23). elif [[ -f /proc/$$/stat && $(uname) == Linux ]] -then N=1024 # number of iterations for each test +then N=2048 # number of iterations for each test unit=bytes tolerance=$((4*N)) # tolerate 4 bytes per iteration to account for malloc artefacts function getmem