Commit 898ed17
chore: regression test for process._getActiveHandles() in 'exit' handler (#34191)
## Summary
Adds a regression test that pins the fix from #34101 against the exact
reproduction in [#34187](#34187):
a CJS module that lazy-loads `node:http` via `setImmediate`, then calls
`process._getActiveHandles()` (plus `_getActiveRequests` /
`getActiveResourcesInfo`) from a `process.on('exit', ...)` handler.
Before #34101 this threw `TypeError: process._getActiveHandles is not a
function`. With the active-process-resources polyfills now in place, the
snippet runs and prints `[]` like Node does. The new spec test ensures
we don't regress.
## Test plan
- [x] `cargo test --package specs_tests --test specs
node::process_get_active_handles_on_exit` passes
- [x] Running `target/debug/deno run -A repro.cjs` matches Node's
behavior
Closes denoland/orchid#131
Co-authored-by: divybot <divybot@users.noreply.github.com>
Co-authored-by: Divy Srivastava <me@littledivy.com>1 parent 19e63a0 commit 898ed17
2 files changed
Lines changed: 37 additions & 0 deletions
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
Lines changed: 29 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
0 commit comments