Commit 3a57b4ced50 for php.net
commit 3a57b4ced5090f0b0bbe93b9789ae355c2f78be4
Author: Ilija Tovilo <ilija.tovilo@me.com>
Date: Wed Jan 14 15:35:48 2026 +0100
Add RUN_RESOURCE_HEAVY_TESTS env var
Disable resource-heavy tests by default (>1GB of memory usage), unless the
RUN_RESOURCE_HEAVY_TESTS env variable is set.
Fixes GH-20762
Closes GH-20935
diff --git a/.circleci/config.yml b/.circleci/config.yml
index eb0c7e06438..eebc3c729a9 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -180,6 +180,7 @@ jobs:
name: Test
no_output_timeout: 30m
command: |
+ export RUN_RESOURCE_HEAVY_TESTS=1
sapi/cli/php run-tests.php \
-d zend_extension=opcache.so \
-d opcache.enable_cli=1 \
diff --git a/.github/actions/freebsd/action.yml b/.github/actions/freebsd/action.yml
index 2a7a323da41..588cb1fc013 100644
--- a/.github/actions/freebsd/action.yml
+++ b/.github/actions/freebsd/action.yml
@@ -106,6 +106,7 @@ runs:
export SKIP_IO_CAPTURE_TESTS=1
export CI_NO_IPV6=1
export STACK_LIMIT_DEFAULTS_CHECK=1
+ export RUN_RESOURCE_HEAVY_TESTS=1
sapi/cli/php run-tests.php \
-P -q -j2 \
-g FAIL,BORK,LEAK,XLEAK \
diff --git a/.github/actions/test-gentoo/action.yml b/.github/actions/test-gentoo/action.yml
index ec9fb0b70c6..f7173842180 100644
--- a/.github/actions/test-gentoo/action.yml
+++ b/.github/actions/test-gentoo/action.yml
@@ -25,6 +25,7 @@ runs:
# Slow tests criteron is doubled because this runner isn't as fast as others
export SKIP_IO_CAPTURE_TESTS=1
export STACK_LIMIT_DEFAULTS_CHECK=1
+ export RUN_RESOURCE_HEAVY_TESTS=1
sapi/cli/php run-tests.php -P -q ${{ inputs.runTestsParameters }} \
-j$(nproc) \
-g FAIL,BORK,LEAK,XLEAK \
diff --git a/.github/actions/test-libmysqlclient/action.yml b/.github/actions/test-libmysqlclient/action.yml
index 185e909f965..3ab4aeb43db 100644
--- a/.github/actions/test-libmysqlclient/action.yml
+++ b/.github/actions/test-libmysqlclient/action.yml
@@ -9,6 +9,7 @@ runs:
export PDO_MYSQL_TEST_HOST=127.0.0.1
export PDO_MYSQL_TEST_USER=root
export PDO_MYSQL_TEST_PASS=root
+ export RUN_RESOURCE_HEAVY_TESTS=1
sapi/cli/php run-tests.php -P -q \
-g FAIL,BORK,LEAK,XLEAK \
--no-progress --offline --show-diff --show-slow 1000 --set-timeout 120 \
diff --git a/.github/actions/test-linux/action.yml b/.github/actions/test-linux/action.yml
index 840ad39f854..337066ea0df 100644
--- a/.github/actions/test-linux/action.yml
+++ b/.github/actions/test-linux/action.yml
@@ -39,6 +39,7 @@ runs:
export PDO_PGSQL_TEST_DSN="pgsql:host=localhost port=5432 dbname=test user=postgres password=postgres"
fi
export SKIP_IO_CAPTURE_TESTS=1
+ export RUN_RESOURCE_HEAVY_TESTS=1
sapi/cli/php run-tests.php -P -q ${{ inputs.runTestsParameters }} \
${{ inputs.enableOpcache == 'true' && '-d zend_extension=opcache.so -d opcache.enable_cli=1' || '' }} \
-d opcache.jit=${{ inputs.jitType }} \
diff --git a/.github/actions/test-macos/action.yml b/.github/actions/test-macos/action.yml
index 9fd485f112e..e0e53a1beb9 100644
--- a/.github/actions/test-macos/action.yml
+++ b/.github/actions/test-macos/action.yml
@@ -17,6 +17,7 @@ runs:
set -x
export SKIP_IO_CAPTURE_TESTS=1
export CI_NO_IPV6=1
+ export RUN_RESOURCE_HEAVY_TESTS=1
sapi/cli/php run-tests.php -P -q ${{ inputs.runTestsParameters }} \
${{ inputs.enableOpcache == 'true' && '-d zend_extension=opcache.so -d opcache.enable_cli=1' || '' }} \
-d opcache.jit=${{ inputs.jitType }} \
diff --git a/Zend/tests/bug55509.phpt b/Zend/tests/bug55509.phpt
index 1ae5b04f8a0..90c410752ec 100644
--- a/Zend/tests/bug55509.phpt
+++ b/Zend/tests/bug55509.phpt
@@ -2,6 +2,7 @@
Bug #55509 (segfault on x86_64 using more than 2G memory)
--SKIPIF--
<?php
+if (!getenv('RUN_RESOURCE_HEAVY_TESTS')) die('skip resource-heavy test');
if (PHP_INT_SIZE == 4) {
die('skip Not for 32-bits OS');
}
diff --git a/Zend/tests/bug74093.phpt b/Zend/tests/bug74093.phpt
index c5fc9da8cbb..d9adfeefa50 100644
--- a/Zend/tests/bug74093.phpt
+++ b/Zend/tests/bug74093.phpt
@@ -2,6 +2,7 @@
Bug #74093 (Maximum execution time of n+2 seconds exceed not written in error_log)
--SKIPIF--
<?php
+if (!getenv('RUN_RESOURCE_HEAVY_TESTS')) die('skip resource-heavy test');
if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
if (PHP_ZTS) die("skip only for no-zts build");
if (substr(PHP_OS, 0, 3) == 'WIN') die("skip not for Windows");
diff --git a/Zend/tests/bug78010.phpt b/Zend/tests/bug78010.phpt
index 82334e78a25..35f2a1d49da 100644
--- a/Zend/tests/bug78010.phpt
+++ b/Zend/tests/bug78010.phpt
@@ -1,5 +1,10 @@
--TEST--
Bug #78010: Segmentation fault during GC
+--SKIPIF--
+<?php
+if (!getenv('RUN_RESOURCE_HEAVY_TESTS')) die('skip resource-heavy test');
+if (getenv("SKIP_SLOW_TESTS")) die('skip slow test');
+?>
--INI--
memory_limit=2G
--FILE--
diff --git a/ext/gd/tests/bug77270.phpt b/ext/gd/tests/bug77270.phpt
index 33246880c53..77608757f8f 100644
--- a/ext/gd/tests/bug77270.phpt
+++ b/ext/gd/tests/bug77270.phpt
@@ -1,7 +1,5 @@
--TEST--
Bug #77270 (imagecolormatch Out Of Bounds Write on Heap)
---INI--
-memory_limit=-1
--EXTENSIONS--
gd
--SKIPIF--
diff --git a/ext/gd/tests/bug77272.phpt b/ext/gd/tests/bug77272.phpt
index f2483f915c1..11fd3b3ce56 100644
--- a/ext/gd/tests/bug77272.phpt
+++ b/ext/gd/tests/bug77272.phpt
@@ -6,6 +6,7 @@
gd
--SKIPIF--
<?php
+if (!getenv('RUN_RESOURCE_HEAVY_TESTS')) die('skip resource-heavy test');
if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.5', '<=')) die('skip upstream fix not yet released');
if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
if (substr(PHP_OS, 0, 3) == 'WIN' && PHP_INT_SIZE === 4) die("skip not for Windows x86");
diff --git a/ext/gd/tests/bug77479.phpt b/ext/gd/tests/bug77479.phpt
index 504ff7abca1..b39b3928b1a 100644
--- a/ext/gd/tests/bug77479.phpt
+++ b/ext/gd/tests/bug77479.phpt
@@ -4,6 +4,7 @@
gd
--SKIPIF--
<?php
+if (!getenv('RUN_RESOURCE_HEAVY_TESTS')) die('skip resource-heavy test');
if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
?>
--INI--
diff --git a/ext/gd/tests/gh16322.phpt b/ext/gd/tests/gh16322.phpt
index 1edc27285d2..1e5ab2f3a6b 100644
--- a/ext/gd/tests/gh16322.phpt
+++ b/ext/gd/tests/gh16322.phpt
@@ -2,8 +2,6 @@
GH-16322 (imageaffine overflow/underflow on affine matrix)
--EXTENSIONS--
gd
---INI--
-memory_limit=-1
--FILE--
<?php
$matrix = [INF, 1, 1, 1, 1, 1];
diff --git a/ext/ldap/tests/GHSA-g665-fm4p-vhff-1.phpt b/ext/ldap/tests/GHSA-g665-fm4p-vhff-1.phpt
index 8e2c4fb160d..fdee0cb43d6 100644
--- a/ext/ldap/tests/GHSA-g665-fm4p-vhff-1.phpt
+++ b/ext/ldap/tests/GHSA-g665-fm4p-vhff-1.phpt
@@ -6,6 +6,7 @@
memory_limit=-1
--SKIPIF--
<?php
+if (!getenv('RUN_RESOURCE_HEAVY_TESTS')) die('skip resource-heavy test');
if (PHP_INT_SIZE !== 4) die("skip only for 32-bit");
if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
?>
diff --git a/ext/ldap/tests/GHSA-g665-fm4p-vhff-2.phpt b/ext/ldap/tests/GHSA-g665-fm4p-vhff-2.phpt
index a69597084be..ef64e25b89c 100644
--- a/ext/ldap/tests/GHSA-g665-fm4p-vhff-2.phpt
+++ b/ext/ldap/tests/GHSA-g665-fm4p-vhff-2.phpt
@@ -6,6 +6,7 @@
memory_limit=-1
--SKIPIF--
<?php
+if (!getenv('RUN_RESOURCE_HEAVY_TESTS')) die('skip resource-heavy test');
if (PHP_INT_SIZE !== 4) die("skip only for 32-bit");
if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
?>
diff --git a/ext/pdo_dblib/tests/GHSA-5hqh-c84r-qjcv.phpt b/ext/pdo_dblib/tests/GHSA-5hqh-c84r-qjcv.phpt
index 431c61951ee..95b33ddb7f3 100644
--- a/ext/pdo_dblib/tests/GHSA-5hqh-c84r-qjcv.phpt
+++ b/ext/pdo_dblib/tests/GHSA-5hqh-c84r-qjcv.phpt
@@ -4,6 +4,7 @@
pdo_dblib
--SKIPIF--
<?php
+if (!getenv('RUN_RESOURCE_HEAVY_TESTS')) die('skip resource-heavy test');
if (PHP_INT_SIZE != 4) die("skip for 32bit platforms only");
if (PHP_OS_FAMILY === "Windows") die("skip not for Windows because the virtual address space for application is only 2GiB");
if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
diff --git a/ext/pdo_sqlite/tests/bug81740.phpt b/ext/pdo_sqlite/tests/bug81740.phpt
index 2b8b9447f0f..2acd865b319 100644
--- a/ext/pdo_sqlite/tests/bug81740.phpt
+++ b/ext/pdo_sqlite/tests/bug81740.phpt
@@ -5,6 +5,7 @@
pdo_sqlite
--SKIPIF--
<?php
+if (!getenv('RUN_RESOURCE_HEAVY_TESTS')) die('skip resource-heavy test');
if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platforms only");
if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
?>
diff --git a/ext/soap/tests/soap_qname_crash.phpt b/ext/soap/tests/soap_qname_crash.phpt
index bcf01d574fa..63c1851286a 100644
--- a/ext/soap/tests/soap_qname_crash.phpt
+++ b/ext/soap/tests/soap_qname_crash.phpt
@@ -4,6 +4,7 @@
soap
--SKIPIF--
<?php
+if (!getenv('RUN_RESOURCE_HEAVY_TESTS')) die('skip resource-heavy test');
if (PHP_INT_SIZE != 8) die("skip: 64-bit only");
?>
--INI--
diff --git a/ext/standard/tests/file/file_get_contents_file_put_contents_5gb.phpt b/ext/standard/tests/file/file_get_contents_file_put_contents_5gb.phpt
index 854996a6481..dd16e885f6e 100644
--- a/ext/standard/tests/file/file_get_contents_file_put_contents_5gb.phpt
+++ b/ext/standard/tests/file/file_get_contents_file_put_contents_5gb.phpt
@@ -2,6 +2,7 @@
Test file_put_contents() and file_get_contents() functions with 5GB string
--SKIPIF--
<?php
+if (!getenv('RUN_RESOURCE_HEAVY_TESTS')) die('skip resource-heavy test');
if (PHP_INT_SIZE < 5) {
// 4=4gb, 5=549gb, 8=9exabytes
die("skip PHP_INT_SIZE<5 will not fit test string in RAM");
diff --git a/ext/standard/tests/strings/gh15613.phpt b/ext/standard/tests/strings/gh15613.phpt
index 8f40ee820c9..44c41acfddd 100644
--- a/ext/standard/tests/strings/gh15613.phpt
+++ b/ext/standard/tests/strings/gh15613.phpt
@@ -2,6 +2,7 @@
GH-15613 overflow on hex strings repeater value
--SKIPIF--
<?php
+if (!getenv('RUN_RESOURCE_HEAVY_TESTS')) die('skip resource-heavy test');
if (PHP_INT_SIZE != 8) die("skip this test is for 64 bit platform only");
?>
--INI--
diff --git a/ext/tidy/tests/parsing_file_too_large.phpt b/ext/tidy/tests/parsing_file_too_large.phpt
index a0118ba9ebd..4db089fc939 100644
--- a/ext/tidy/tests/parsing_file_too_large.phpt
+++ b/ext/tidy/tests/parsing_file_too_large.phpt
@@ -4,6 +4,7 @@
tidy
--SKIPIF--
<?php
+if (!getenv('RUN_RESOURCE_HEAVY_TESTS')) die('skip resource-heavy test');
if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
if (getenv("SKIP_ASAN")) die("skip too big for asan");
diff --git a/sapi/fpm/tests/bug77023-pm-dynamic-blocking-sigquit.phpt b/sapi/fpm/tests/bug77023-pm-dynamic-blocking-sigquit.phpt
index 458948f6765..a571fe0bb36 100644
--- a/sapi/fpm/tests/bug77023-pm-dynamic-blocking-sigquit.phpt
+++ b/sapi/fpm/tests/bug77023-pm-dynamic-blocking-sigquit.phpt
@@ -6,7 +6,7 @@
<?php
include "skipif.inc";
if (!function_exists('pcntl_sigprocmask')) die('skip Requires pcntl_sigprocmask()');
-if (!getenv("FPM_RUN_RESOURCE_HEAVY_TESTS")) die("skip resource heavy test");
+if (!getenv("RUN_RESOURCE_HEAVY_TESTS")) die("skip resource-heavy test");
if (getenv('SKIP_SLOW_TESTS')) die('skip slow tests excluded by request');
?>
--FILE--
diff --git a/sapi/fpm/tests/proc-idle-timeout.phpt b/sapi/fpm/tests/proc-idle-timeout.phpt
index 0c1d10cab87..313b543b4cb 100644
--- a/sapi/fpm/tests/proc-idle-timeout.phpt
+++ b/sapi/fpm/tests/proc-idle-timeout.phpt
@@ -3,7 +3,7 @@
--SKIPIF--
<?php
include "skipif.inc";
-if (!getenv("FPM_RUN_RESOURCE_HEAVY_TESTS")) die("skip resource heavy test");
+if (!getenv("RUN_RESOURCE_HEAVY_TESTS")) die("skip resource-heavy test");
if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
?>
--FILE--