From 1ef14d21b281d023a839c9b9b12a77a215892b01 Mon Sep 17 00:00:00 2001 From: Jakub Zelenka Date: Sun, 20 Sep 2026 09:08:18 +0200 Subject: [PATCH] Skip bz2 GH-20807 test when less than 13 GiB of memory is available The decompressed output of this test peaks at more than 12 GiB of RSS. On smaller machines, such as the 7 GB GitHub-hosted runners used for private repositories, this exhausts the whole VM and the OOM killer takes the test runner down with it, so the job dies with a runner shutdown signal instead of a test failure. Gate the test on MemAvailable from /proc/meminfo like the other resource-heavy tests gate on memory, so it keeps running on the 16 GB public runners and skips itself elsewhere. --- ext/bz2/tests/gh20807.phpt | 6 ++++++ 1 file changed, 6 insertions(+) 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--