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

Function withTimeout

test/mount.test.js:9–14  ·  view source on GitHub ↗
(promise, ms = 5000)

Source from the content-addressed store, hash-verified

7const TEST_FILE_VM = path.join(MOUNT_DIR, 'vm_hello.txt');
8
9function withTimeout(promise, ms = 5000) {
10 return Promise.race([
11 promise,
12 new Promise((_, reject) => setTimeout(() => reject(new Error(`Timeout after ${ms}ms`)), ms))
13 ]);
14}
15
16async function test() {
17 console.log("Initializing AgentVM with mount...");

Callers 1

testFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected