test: force GC in test-file-write-stream4
Reduce `test/parallel/test-file-write-stream4.js` flakiness. Refs: https://github.com/nodejs/node/pull/57927 PR-URL: https://github.com/nodejs/node/pull/57930 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: LiviaMedeiros <livia@cirno.name> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
This commit is contained in:
parent
da6a13c338
commit
275ea8e7ef
@ -1,3 +1,4 @@
|
||||
// Flags: --expose-gc
|
||||
'use strict';
|
||||
|
||||
// Test that 'close' emits once and not twice when `emitClose: true` is set.
|
||||
@ -17,4 +18,8 @@ const fileWriteStream = fs.createWriteStream(filepath, {
|
||||
});
|
||||
|
||||
fileReadStream.pipe(fileWriteStream);
|
||||
fileWriteStream.on('close', common.mustCall());
|
||||
fileWriteStream.on('close', common.mustCall(() => {
|
||||
// TODO(lpinca): Remove the forced GC when
|
||||
// https://github.com/nodejs/node/issues/54918 is fixed.
|
||||
globalThis.gc({ type: 'major' });
|
||||
}));
|
||||
|
Loading…
x
Reference in New Issue
Block a user