* Large File Download Tests (1MB, 10MB, 50MB) * * Uses a local HTTP server to test downloading large files into the VM filesystem. * This tests the TCP flow control and buffer management at scale. * * Note: The VM has limited disk space (~56MB), so we test up to 50MB. * The VM has built-in n
(promise, ms)
| 14 | */ |
| 15 | |
| 16 | function withTimeout(promise, ms) { |
| 17 | return Promise.race([ |
| 18 | promise, |
| 19 | new Promise((_, reject) => setTimeout(() => reject(new Error(`Timeout after ${ms}ms`)), ms)) |
| 20 | ]); |
| 21 | } |
| 22 | |
| 23 | // Create a local HTTP server that serves files of specified sizes |
| 24 | // No rate limiting - relies on VM's built-in network rate limiting |