mirror of
https://github.com/nodejs/node.git
synced 2025-04-28 13:40:37 +00:00

This makes sure that the tests are run on actual heap snapshots and prints out missing paths when it cannot be found, which makes failures easier to debug, and removes the unnecessary requirement for BaseObjects to be root - which would make the heap snapshot containment view rather noisy and is not conceptually correct, since they are actually held by the BaseObjectList held by the realms. PR-URL: https://github.com/nodejs/node/pull/57417 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
27 lines
828 B
JavaScript
27 lines
828 B
JavaScript
'use strict';
|
|
|
|
// This tests heap snapshot integration of fs promise.
|
|
|
|
require('../common');
|
|
const { validateByRetainingPath, validateByRetainingPathFromNodes } = require('../common/heap');
|
|
const fs = require('fs').promises;
|
|
const assert = require('assert');
|
|
|
|
// Before fs promise is used, no FSReqPromise should be created.
|
|
{
|
|
const nodes = validateByRetainingPath('Node / FSReqPromise', []);
|
|
assert.strictEqual(nodes.length, 0);
|
|
}
|
|
|
|
fs.stat(__filename);
|
|
|
|
{
|
|
const nodes = validateByRetainingPath('Node / FSReqPromise', []);
|
|
validateByRetainingPathFromNodes(nodes, 'Node / FSReqPromise', [
|
|
{ node_name: 'FSReqPromise', edge_name: 'native_to_javascript' },
|
|
]);
|
|
validateByRetainingPathFromNodes(nodes, 'Node / FSReqPromise', [
|
|
{ node_name: 'Node / AliasedFloat64Array', edge_name: 'stats_field_array' },
|
|
]);
|
|
}
|