-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Highlights: * Using a random port works (`node inspect --port=0 script.js`) * `takeHeapSnapshot()` creates valid snapshots again
- Loading branch information
Jan Krems
committed
Jan 30, 2018
1 parent
6790ba9
commit 0a5cced
Showing
11 changed files
with
119 additions
and
40 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -179,3 +179,4 @@ A simple bug fix: | |
``` | ||
fix: Handle multi-byte characters in search logic | ||
``` | ||
|
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
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
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,34 @@ | ||
'use strict'; | ||
const { test } = require('tap'); | ||
const { readFileSync, unlinkSync } = require('fs'); | ||
|
||
const startCLI = require('./start-cli'); | ||
const filename = 'node.heapsnapshot'; | ||
|
||
function cleanup() { | ||
try { | ||
unlinkSync(filename); | ||
} catch (_) { | ||
// Ignore. | ||
} | ||
} | ||
|
||
cleanup(); | ||
|
||
test('Heap profiler take snapshot', (t) => { | ||
const cli = startCLI(['examples/empty.js']); | ||
|
||
function onFatal(error) { | ||
cli.quit(); | ||
throw error; | ||
} | ||
|
||
// Check that the snapshot is valid JSON. | ||
return cli.waitForInitialBreak() | ||
.then(() => cli.waitForPrompt()) | ||
.then(() => cli.command('takeHeapSnapshot()')) | ||
.then(() => JSON.parse(readFileSync(filename, 'utf8'))) | ||
.then(() => cleanup()) | ||
.then(() => cli.quit()) | ||
.then(null, onFatal); | ||
}); |
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