From 3a2e4d854311b1f19b4ace21d9c66a8a2134c381 Mon Sep 17 00:00:00 2001 From: loks0n <22452787+loks0n@users.noreply.github.com> Date: Mon, 20 Jul 2026 16:53:30 +0100 Subject: [PATCH] Make testCreateDeploymentLarge compression-agnostic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The test asserted buildSize > 10MB by copying an identical video (cp blue.mp4 copy.mp4). That holds for gzip-of-tar but not for squashfs, which deduplicates the two identical copies down to ~7MB. Generate a unique, incompressible 12MB file (head -c … /dev/urandom) instead, so the assertion holds under every build compression — gzip, zstd, and squashfs+lz4 — rather than relying on the packer keeping redundant bytes. Co-Authored-By: Claude Opus 4.8 (1M context) --- tests/e2e/Services/Functions/FunctionsCustomServerTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php index c2dbe7c614..72b4284f38 100644 --- a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php +++ b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php @@ -1027,7 +1027,7 @@ final class FunctionsCustomServerTest extends Scope 'entrypoint' => 'index.js', 'code' => $curlFile, 'activate' => true, - 'commands' => 'cp blue.mp4 copy.mp4 && ls -al' // +7MB buildSize + 'commands' => 'head -c 12582912 /dev/urandom > random.bin && ls -al' // +12MB unique, incompressible: survives squashfs dedup and any compressor ]); $counter++; $id = $largeTag['body']['$id']; @@ -1050,7 +1050,7 @@ final class FunctionsCustomServerTest extends Scope $this->assertEquals(200, $deployment['headers']['status-code']); $this->assertEquals('ready', $deployment['body']['status']); $this->assertEquals($deploymentSize, $deployment['body']['sourceSize']); - $this->assertGreaterThan(1024 * 1024 * 10, $deployment['body']['buildSize']); // ~7MB video file + 10MB sample file + $this->assertGreaterThan(1024 * 1024 * 10, $deployment['body']['buildSize']); // ~7MB video + 12MB incompressible sample; compression/dedup-agnostic }, 120000, 500); }