Repository navigation
Commit 0351622
authored
test: release each test file's jest environment when it finishes (#22729)
* test: release each test file's jest environment when it finishes
Two harness patches outlived the file that made them, so a jest worker
kept every finished file's environment alive: deprecationTracking wrapped
the shared util.deprecate on top of the previous file's wrapper, and the
runner's vm.runInThisContext left expect and it on the worker's own global.
Jest 27 never recycles workers on Node 16, so the heap neared its limit
and the last TestCases build crawled through back-to-back full GCs past
the 60s timeout.
* test: clear globals a bundle defines that can't be deleted
A top-level var or function can't be deleted from the worker's global, and
strict-mode delete threw, failing the file. Clear it instead, skip what
can't be changed, and read the global with `this`, which Node 10 has.1 parent 2f4b6be commit 0351622
2 files changed
Lines changed: 25 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
144 | 145 | | |
145 | 146 | | |
146 | 147 | | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
42 | 48 | | |
43 | 49 | | |
44 | 50 | | |
| |||
0 commit comments