MCPcopy Create free account
hub / github.com/deepclause/agentvm / withTimeout

Function withTimeout

test/network/large-file.test.js:16–21  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

14 */
15
16function 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

Callers 1

testFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected