mirror of
https://github.com/appwrite/appwrite.git
synced 2026-11-18 20:36:03 +00:00
Make testCreateDeploymentLarge compression-agnostic
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) <noreply@anthropic.com>
This commit is contained in:
1 parent
7dfadfe2dc
commit
3a2e4d8543
1 file changed
+2
-2
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user