Commit ec17597
authored
fix(test): replace --runInBand with worker children + per-worker DB isolation (#3558)
* fix(test): replace --runInBand with worker children + per-worker DB isolation
Drops --runInBand from test:coverage so Jest spawns worker child processes,
making workerIdleMemoryLimit (#3550) effective and preventing the 4.9 GB OOM
seen in trawl_node (#1074). Adds JEST_WORKER_ID suffix to db.uri in
config/index.js so each worker targets an independent MongoDB database,
preventing data races when the CI DEVKIT_NODE_db_uri override is active.
globalSetup (no JEST_WORKER_ID) continues to operate on the unsuffixed URI.
* fix(test): use URL API for worker DB URI suffix (safer path manipulation)
Replaces the regex-based URI suffix with the URL API to correctly append
the worker suffix to the database name path segment. Handles URIs with no
explicit db name (defaults to 'test'), preserves query strings, and avoids
potential corruption of host/port components.1 parent f09c684 commit ec17597
2 files changed
Lines changed: 23 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
172 | 194 | | |
173 | 195 | | |
174 | 196 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
0 commit comments