Commit a34fa7d
authored
fix(gateway): resolve flaky tests from port conflicts and shared state (#75)
* fix(gateway): use OS-assigned port in app.test.ts to avoid EADDRINUSE
Fixes #72
The integration tests in app.test.ts were using the default port 3100,
which conflicts with sdk.integration.test.ts when running in parallel.
Changes:
- Set PORT=0 in vi.hoisted block to get an OS-assigned port
- Add afterAll hook to properly close the server after tests
- Import server export for cleanup
* fix(gateway): isolate tests with shared state using forks pool
Fixes #70
The concurrency module has shared state that was causing "socket hang up"
errors when concurrency.test.ts ran in parallel with integration tests.
Changes:
- Use poolMatchGlobs to run integration and concurrency tests in forks pool
- Other tests continue to run in parallel threads pool for speed
- Forks pool provides process isolation, preventing shared state conflicts1 parent 9ed751e commit a34fa7d
File tree
2 files changed
+31
-4
lines changed- packages/gateway
- __tests__/integration
2 files changed
+31
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
11 | 19 | | |
12 | 20 | | |
13 | 21 | | |
14 | 22 | | |
15 | 23 | | |
16 | 24 | | |
17 | | - | |
| 25 | + | |
18 | 26 | | |
19 | 27 | | |
20 | 28 | | |
21 | 29 | | |
| 30 | + | |
| 31 | + | |
22 | 32 | | |
23 | 33 | | |
24 | 34 | | |
| |||
29 | 39 | | |
30 | 40 | | |
31 | 41 | | |
32 | | - | |
33 | | - | |
| 42 | + | |
| 43 | + | |
34 | 44 | | |
35 | 45 | | |
36 | 46 | | |
37 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
38 | 55 | | |
39 | 56 | | |
40 | 57 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
11 | 21 | | |
12 | 22 | | |
13 | 23 | | |
| |||
0 commit comments