From 7e67fca11d62db6a581391ced7d2ecb7805dcc6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Mon, 26 Oct 2026 11:27:11 +0100 Subject: [PATCH] test: keep the out-of-memory query under the hard limit in worker mode Worker mode holds four copies of the query string while populating the superglobals, so a 5 MiB query crossed the 16 MiB hard limit on the official PHP images and killed the test binary. --- frankenphp_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frankenphp_test.go b/frankenphp_test.go index b8e58367f7..84199ba81d 100644 --- a/frankenphp_test.go +++ b/frankenphp_test.go @@ -1724,8 +1724,8 @@ func testOutOfMemory(t *testing.T, opts *testOptions) { body, _ = testGet("http://example.com/out-of-memory.php", handler, t) assert.Equal(t, "ok", body) - // $_GET is populated before the script runs; stay under the hard limit (twice memory_limit), past which PHP exits - body, _ = testGet("http://example.com/out-of-memory.php?q="+strings.Repeat("a", 5<<20), handler, t) + // $_GET is populated before the script runs; its copies (4 in worker mode) must cross memory_limit but stay under the hard limit (twice memory_limit), past which PHP exits + body, _ = testGet("http://example.com/out-of-memory.php?q="+strings.Repeat("a", 3<<20), handler, t) if hardLimit { assert.Contains(t, body, "Allowed memory size of 8388608 bytes exhausted") }