Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
style fixup
  • Loading branch information
Leonardo Ivo Julca authored and Slayer95 committed Dec 20, 2022
commit f358742af6853d38f75820c54a58eba9f24d383e
8 changes: 4 additions & 4 deletions test/fixtures/stream-readable-leak.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ async function run() {
process.exitCode = 1;

// Long-lived file handle. Ensure we keep a reference to it.
const fh = await open(__filename)
fh.on('close', mustNotCall())
const fh = await open(__filename);
fh.on('close', mustNotCall());

const stream = fh.createReadStream({ autoClose: false })
const stream = fh.createReadStream({ autoClose: false });
// Keeping the file handle open shouldn't prevent the stream from being GCed.
registry.register(stream, `[GC] Collected readable ${fh.fd}`);

for await (const chunk of stream.iterator({ destroyOnReturn: false })) {
break
break;
}

// Keep a reference to the file handle
Expand Down