From e2fef24a3820b1b531a3a6891c6244942add27a5 Mon Sep 17 00:00:00 2001 From: Andrey Pechkurov Date: Thu, 23 Jul 2020 23:25:44 +0300 Subject: [PATCH 1/2] test: fix test-heapdump-zlib Refs: #34048 --- test/pummel/test-heapdump-zlib.js | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/test/pummel/test-heapdump-zlib.js b/test/pummel/test-heapdump-zlib.js index 0f86576bd1f2fa..2f20226ac87729 100644 --- a/test/pummel/test-heapdump-zlib.js +++ b/test/pummel/test-heapdump-zlib.js @@ -1,17 +1,28 @@ // Flags: --expose-internals 'use strict'; -require('../common'); +const common = require('../common'); const { validateSnapshotNodes } = require('../common/heap'); const zlib = require('zlib'); validateSnapshotNodes('Node / ZlibStream', []); -// eslint-disable-next-line no-unused-vars -const gunzip = zlib.createGunzip(); + +const gzip = zlib.createGzip(); validateSnapshotNodes('Node / ZlibStream', [ { children: [ - { node_name: 'Zlib', edge_name: 'wrapped' }, - { node_name: 'Node / zlib_memory', edge_name: 'zlib_memory' } + { node_name: 'Zlib', edge_name: 'wrapped' } + // zlib memory is initialized lazily ] } ]); + +gzip.write('hello world', common.mustCall(() => { + validateSnapshotNodes('Node / ZlibStream', [ + { + children: [ + { node_name: 'Zlib', edge_name: 'wrapped' }, + { node_name: 'Node / zlib_memory', edge_name: 'zlib_memory' } + ] + } + ]); +})); From 4f7a2c06f23e637ac830ec7e755be00a70848233 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Thu, 23 Jul 2020 16:52:35 -0700 Subject: [PATCH 2/2] fixup! test: fix test-heapdump-zlib --- test/pummel/test-heapdump-zlib.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/pummel/test-heapdump-zlib.js b/test/pummel/test-heapdump-zlib.js index 2f20226ac87729..ef906c9935274e 100644 --- a/test/pummel/test-heapdump-zlib.js +++ b/test/pummel/test-heapdump-zlib.js @@ -11,7 +11,7 @@ validateSnapshotNodes('Node / ZlibStream', [ { children: [ { node_name: 'Zlib', edge_name: 'wrapped' } - // zlib memory is initialized lazily + // No entry for memory because zlib memory is initialized lazily. ] } ]);