test: remove deadlock workaround

PR-URL: https://github.com/nodejs/node/pull/58047
Refs: https://github.com/nodejs/node/pull/47452
Refs: https://github.com/nodejs/node/issues/54918
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
This commit is contained in:
Joyee Cheung 2025-04-26 23:10:12 +02:00 committed by Node.js GitHub Bot
parent 6de55f7ffb
commit c2d81569d5
3 changed files with 3 additions and 8 deletions

View File

@ -1,4 +1,3 @@
// Flags: --expose-gc
'use strict';
// Test that 'close' emits once and not twice when `emitClose: true` is set.
@ -18,8 +17,4 @@ const fileWriteStream = fs.createWriteStream(filepath, {
});
fileReadStream.pipe(fileWriteStream);
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' });
}));
fileWriteStream.on('close', common.mustCall());

View File

@ -23,7 +23,7 @@ const server = net.createServer(common.mustCall(function(conn) {
}
while (conn.write(Buffer.from(data)));
globalThis.gc({ type: 'major' });
globalThis.gc({ type: 'minor' });
// The buffer allocated above should still be alive.
}

View File

@ -21,7 +21,7 @@ const server = net.createServer(common.mustCall(function(conn) {
}
while (conn.write(data, 'hex'));
globalThis.gc({ type: 'major' });
globalThis.gc({ type: 'minor' });
// The buffer allocated inside the .write() call should still be alive.
}