Skip to content

Commit ca0f7db

Browse files
committed
Fix memory exhaustion in MCP server chaos tests
Resolved "Worker terminated due to reaching memory limit" errors by: - Increased Node.js heap size to 4GB via NODE_OPTIONS - Extended test timeout from 5000ms to 30000ms for chaos tests - Configured Vitest to use forked processes with proper isolation This prevents memory leaks between test runs and allows resource-intensive chaos tests to complete successfully.
1 parent cf807fb commit ca0f7db

8 files changed

Lines changed: 274 additions & 1 deletion

packages/mcp-server/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"dev": "echo 'MCP server should be started by Claude Code, not npm run dev. Use npm run dev:mcp to start manually.'",
1010
"dev:start": "tsx watch src/index.ts",
1111
"start": "node dist/index.js",
12-
"test": "vitest --run",
12+
"test": "NODE_OPTIONS='--max-old-space-size=4096' vitest --run",
1313
"test:coverage": "vitest run --coverage",
1414

1515
"test:input": "vitest --run tests/garbage-input.test.ts",

packages/mcp-server/vitest.config.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@ import { defineConfig } from 'vitest/config';
33
export default defineConfig({
44
test: {
55
environment: 'node',
6+
testTimeout: 30000, // Increase timeout for chaos tests from default 5000ms
7+
pool: 'forks', // Use forked processes for better isolation
8+
poolOptions: {
9+
forks: {
10+
singleFork: false, // Allow parallel execution
11+
isolate: true, // Isolate each test file
12+
},
13+
},
614
coverage: {
715
provider: 'v8',
816
reporter: ['text', 'html'],
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# GraphDone E2E Test Report
2+
3+
**Generated:** Thu Nov 13 06:16:01 PM PST 2025
4+
**VM Name:** graphdone-test-1763086561
5+
**Branch:** vm_multi-pass
6+
**Test Duration:** TBD
7+
8+
---
9+
10+
## Test Summary
11+
12+
## 🚀 VM Launch
13+
14+
✅ VM launched successfully
15+
16+
```
17+
18+
VM: graphdone-test-1763086561
19+
20+
Branch: vm_multi-pass
21+
22+
```
23+
24+
## ⏳ VM Provisioning
25+
26+
✅ VM provisioning complete
27+
28+
## 🔍 Installation Verification
29+
30+
❌ GraphDone directory not found
31+
32+
## ❌ Tests Failed
33+
34+
Exit code: 1
35+
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# GraphDone E2E Test Report
2+
3+
**Generated:** Thu Nov 13 06:17:57 PM PST 2025
4+
**VM Name:** graphdone-test-1763086677
5+
**Branch:** main
6+
**Test Duration:** TBD
7+
8+
---
9+
10+
## Test Summary
11+
12+
## 🚀 VM Launch
13+
14+
✅ VM launched successfully
15+
16+
```
17+
18+
VM: graphdone-test-1763086677
19+
20+
Branch: main
21+
22+
```
23+
24+
## ⏳ VM Provisioning
25+
26+
✅ VM provisioning complete
27+
28+
## 🔍 Installation Verification
29+
30+
✅ GraphDone installed at ~/graphdone
31+
32+
## 🧹 Linting
33+
34+
✅ Linting passed
35+
36+
## 🔤 Type Checking
37+
38+
✅ Type checking passed
39+
40+
## 🏗️ Build Process
41+
42+
✅ Build completed successfully
43+
44+
## 🧪 Unit Tests
45+
46+
✅ Unit tests passed
47+
48+
```
49+
50+
@graphdone/server:test: Test Files 1 passed (1)
51+
@graphdone/server:test: Tests 2 passed (2)
52+
@graphdone/server:test: Start at 18:22:07
53+
@graphdone/server:test: Duration 346ms (transform 24ms, setup 0ms, collect 24ms, tests 1ms, environment 0ms, prepare 78ms)
54+
@graphdone/server:test:
55+
```
56+
57+
## 🎭 E2E Tests
58+
59+
✅ E2E tests passed
60+
61+
## 🔌 Functional API Tests
62+
63+
❌ Web UI not accessible (port 3127)
64+
65+
❌ GraphQL API health check failed (port 4127)
66+
67+
## ❌ Tests Failed
68+
69+
Exit code: 2
70+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# GraphDone E2E Test Report
2+
3+
**Generated:** Thu Nov 13 06:19:09 PM PST 2025
4+
**VM Name:** graphdone-test-1763086749
5+
**Branch:** develop
6+
**Test Duration:** TBD
7+
8+
---
9+
10+
## Test Summary
11+
12+
## 🚀 VM Launch
13+
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# GraphDone E2E Test Report
2+
3+
**Generated:** Thu Nov 13 06:19:43 PM PST 2025
4+
**VM Name:** graphdone-test-1763086783
5+
**Branch:** vm_multi-pass
6+
**Test Duration:** TBD
7+
8+
---
9+
10+
## Test Summary
11+
12+
## 🚀 VM Launch
13+
14+
✅ VM launched successfully
15+
16+
```
17+
18+
VM: graphdone-test-1763086783
19+
20+
Branch: vm_multi-pass
21+
22+
```
23+
24+
## ⏳ VM Provisioning
25+
26+
✅ VM provisioning complete
27+
28+
## 🔍 Installation Verification
29+
30+
✅ GraphDone installed at ~/graphdone
31+
32+
## 🧹 Linting
33+
34+
✅ Linting passed
35+
36+
## 🔤 Type Checking
37+
38+
✅ Type checking passed
39+
40+
## 🏗️ Build Process
41+
42+
✅ Build completed successfully
43+
44+
## 🧪 Unit Tests
45+
46+
✅ Unit tests passed
47+
48+
```
49+
50+
@graphdone/server:test: Test Files 1 passed (1)
51+
@graphdone/server:test: Tests 2 passed (2)
52+
@graphdone/server:test: Start at 18:24:24
53+
@graphdone/server:test: Duration 322ms (transform 45ms, setup 0ms, collect 41ms, tests 1ms, environment 0ms, prepare 102ms)
54+
@graphdone/server:test:
55+
```
56+
57+
## 🎭 E2E Tests
58+
59+
✅ E2E tests passed
60+
61+
## 🔌 Functional API Tests
62+
63+
❌ Web UI not accessible (port 3127)
64+
65+
❌ GraphQL API health check failed (port 4127)
66+
67+
## ❌ Tests Failed
68+
69+
Exit code: 2
70+
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# GraphDone E2E Test Report
2+
3+
**Generated:** Thu Nov 13 06:32:31 PM PST 2025
4+
**VM Name:**
5+
**Branch:** vm_multi-pass
6+
**Test Duration:** TBD
7+
8+
---
9+
10+
## Test Summary
11+
12+
## 🚀 VM Launch
13+
14+
✅ VM launched successfully
15+
16+
```
17+
18+
VM: graphdone-vm-cosmic-hawk-2241
19+
20+
Branch: vm_multi-pass
21+
22+
```
23+
24+
## ⏳ VM Provisioning
25+
26+
✅ VM provisioning complete
27+
28+
## 🔍 Installation Verification
29+
30+
✅ GraphDone installed at ~/graphdone
31+
32+
## 🧹 Linting
33+
34+
✅ Linting passed
35+
36+
## 🔤 Type Checking
37+
38+
✅ Type checking passed
39+
40+
## 🏗️ Build Process
41+
42+
✅ Build completed successfully
43+
44+
## 🧪 Unit Tests
45+
46+
✅ Unit tests passed
47+
48+
```
49+
50+
@graphdone/server:test: Test Files 1 passed (1)
51+
@graphdone/server:test: Tests 2 passed (2)
52+
@graphdone/server:test: Start at 18:36:06
53+
@graphdone/server:test: Duration 283ms (transform 26ms, setup 0ms, collect 18ms, tests 2ms, environment 0ms, prepare 78ms)
54+
@graphdone/server:test:
55+
```
56+
57+
## 🎭 E2E Tests
58+
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# GraphDone E2E Test Report
2+
3+
**Generated:** Thu Nov 13 07:38:41 PM PST 2025
4+
**VM Name:**
5+
**Branch:** vm_multi-pass
6+
**Test Duration:** TBD
7+
8+
---
9+
10+
## Test Summary
11+
12+
## 🚀 VM Launch
13+
14+
❌ Failed to launch VM
15+
16+
## ❌ Tests Failed
17+
18+
Exit code: 1
19+

0 commit comments

Comments
 (0)