summaryrefslogtreecommitdiff
path: root/test/parallel/test-stream-write-destroy.js
AgeCommit message (Collapse)Author
2019-09-22stream: do not flush destroyed writableRobert Nagy
It doesn't make much sense to flush a stream which has been destroyed. PR-URL: https://github.com/nodejs/node/pull/29028 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2018-11-10stream: make `.destroy()` interact better with write queueAnna Henningsen
Make sure that it is safe to call the callback for `_write()` even in the presence of `.destroy()` calls during that write. In particular, letting the write queue continue processing would previously have thrown an exception, because processing writes after calling `.destroy()` is forbidden. One test had to be modified to account for the fact that callbacks for writes will now always be called, even when the stream is destroyed during the process. PR-URL: https://github.com/nodejs/node/pull/24062 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>