Commit Graph

2 Commits

Author SHA1 Message Date
Luigi Pinca
d5e4e19470 test: improve test-stream-duplex-readable-end
- Remove unneeded listener for the `'error'` event.
- Use `common.mustCall()`.
- Verify that the `src` stream gets paused.

PR-URL: https://github.com/nodejs/node/pull/36056
Refs: https://github.com/nodejs/node/pull/35941
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Ricky Zhou <0x19951125@gmail.com>
2020-11-14 18:29:18 +01:00
Momtchil Momtchev
5a3f43b255 stream: fix regression on duplex end
Decide the return status of writeOrBuffer before
calling stream.write which can reset state.length

Add unit test for #35926

Refs: https://github.com/nodejs/node/issues/35926

PR-URL: https://github.com/nodejs/node/pull/35941
Fixes: https://github.com/nodejs/node/issues/35926
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-11-04 05:12:38 -08:00