1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

tests/leaks.sh: increase tolerances again

Another day, another attempt to quash regress test fails caused by
implausibly small memory "leaks".

Apparently, on later macOS versions, 'ps' got more unreliable, so
increase tolerance from 8 to 12 bytes. Maximum reported leaks.sh
failure was 188 KiB after 16384 iterations (11 bytes/iteration).

And on some Linux versions, /proc sometimes acts weird. The
following is apparently consistent on Arch Linux:
	shcomp-leaks.ksh[177]: memory leak with read -C when using
	<<< (leaked approx 65536 bytes after 4096 iterations)
...which is 16 bytes per iteration, still not large enough to make
a real leak plausible.

Resolves: https://github.com/ksh93/ksh/issues/363
This commit is contained in:
Martijn Dekker 2021-12-06 09:58:00 +01:00
parent 17f13345dc
commit c842f46bbd

View file

@ -39,7 +39,7 @@ then N=512 # number of iterations for each test
elif [[ -f /proc/$$/stat && $(uname) == Linux ]]
then N=4096 # number of iterations for each test
unit=bytes
tolerance=$((9*N)) # tolerate 9 bytes per iteration to account for malloc artefacts
tolerance=$((16*N)) # tolerate 16 bytes per iteration to account for malloc artefacts
function getmem
{
cut -f 23 -d ' ' </proc/$$/stat
@ -61,7 +61,7 @@ elif n=$(ps -o rss= -p "$$" 2>/dev/null) &&
let "($n) == ($n) && n > 0"
then N=16384
unit=KiB
tolerance=$((8*N/1024)) # tolerate 8 bytes per iteration to account for malloc/ps artefacts
tolerance=$((12*N/1024))# tolerate 12 bytes per iteration to account for malloc/ps artefacts
function getmem
{
ps -o rss= -p "$$"