diff --git a/ext/bz2/tests/gh20807.phpt b/ext/bz2/tests/gh20807.phpt index ee3238b711b9..ed52c7085858 100644 --- a/ext/bz2/tests/gh20807.phpt +++ b/ext/bz2/tests/gh20807.phpt @@ -12,6 +12,12 @@ if (PHP_OS === 'FreeBSD') die('skip Worker does not handle OOM gracefully'); if (PHP_OS_FAMILY === 'Darwin') die('skip Too slow'); if (PHP_INT_SIZE !== 8) die('skip Only for 64-bit systems'); if (getenv('SKIP_ASAN')) die('skip ASAN makes this test too slow'); +// The decompressed output needs more than 12 GiB of memory at its peak, which +// takes down smaller machines (e.g. 7 GB CI runners) with the OOM killer. +$memInfo = @file_get_contents('/proc/meminfo'); +if ($memInfo && preg_match('/MemAvailable:\s+(\d+) kB/', $memInfo, $m) && $m[1] < 13 * 1024 * 1024) { + die('skip Insufficient available memory (less than 13 GiB)'); +} ?> --FILE--