-
Notifications
You must be signed in to change notification settings - Fork 30k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
src: remove unnecessary Worker.parent_port_ tracking
- Loading branch information
1 parent
5a3de82
commit 40f8b6b
Showing
3 changed files
with
22 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
'use strict'; | ||
const common = require('../common'); | ||
const assert = require('assert'); | ||
const { getHeapSnapshot } = require('v8'); | ||
const { isMainThread, Worker } = require('worker_threads'); | ||
|
||
// Checks taking heap snapshot at the exit event listener of Worker doesn't | ||
// crash the process. | ||
// Regression for https://github.com/nodejs/node/issues/43122. | ||
if (isMainThread) { | ||
const worker = new Worker(__filename); | ||
|
||
worker.once('exit', common.mustCall(code => { | ||
assert.strictEqual(code, 0); | ||
getHeapSnapshot().pipe(process.stdout); | ||
})); | ||
} |