Skip to content

Commit f2fd19e

Browse files
lpincaRafaelGSS
authored andcommitted
test: force GC in test-file-write-stream4
Reduce `test/parallel/test-file-write-stream4.js` flakiness. Refs: #57927 PR-URL: #57930 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: LiviaMedeiros <livia@cirno.name> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
1 parent da05add commit f2fd19e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

test/parallel/test-file-write-stream4.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Flags: --expose-gc
12
'use strict';
23

34
// Test that 'close' emits once and not twice when `emitClose: true` is set.
@@ -17,4 +18,8 @@ const fileWriteStream = fs.createWriteStream(filepath, {
1718
});
1819

1920
fileReadStream.pipe(fileWriteStream);
20-
fileWriteStream.on('close', common.mustCall());
21+
fileWriteStream.on('close', common.mustCall(() => {
22+
// TODO(lpinca): Remove the forced GC when
23+
// https://github.com/nodejs/node/issues/54918 is fixed.
24+
globalThis.gc({ type: 'major' });
25+
}));

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy