Uh oh!
There was an error while loading. Please reload this page.
test: add tests for stream3 buffering using cork - #6493
Conversation
calvinmetcalf
commented
Apr 30, 2016
@nodejs/streams |
mcollina
commented
May 1, 2016
Thanks!!! You might want to check this runs on node v4, just in case. I think we should start the habit of explaining the tests in plain English first, because otherwise they imply a lot of knowledge around the stream state machine and they might scare newcomers. Most of it is already explained in the comments, it's probably just a matter of putting a paragraph to describe it at the beginning. Use How about you add a test also for |
alexjeffburke
commented
May 1, 2016
Thanks for the feedback @mcollina - so I've just pushed an update with the following changes:
Regarding Finally, happy to add a paragraph but the question would be where and using /* */ or multiple // ? Could you perhaps point me to another file where this is done, keen to follow not set any precedents for now :) |
calvinmetcalf
commented
May 1, 2016
that would be amazing as for comment style I believe they tend to be |
Left a couple nits pointing where |
alexjeffburke
commented
May 1, 2016
@jasnell appreciate you taking a look! I'm happy to do that, but per discussions of @nodejs/streams it may be preferable to allow these to run against all versions of node that implement streams3. What could be worth an explicit decision is if that should be evident within 'in-tree' files or if any necessary glue be added in ports to readable-stream repo. |
jasnell
commented
May 1, 2016
Works for me... as I said, feel free to ignore ;-) That's actually the main reason why I didn't go through all of the existing tests and change them to use Come to think of it, as a best practice it might be a good idea to explicitly indicate (using code comments) in the tests themselves which node.js versions the test needs to be able to run on. |
Trott
commented
May 2, 2016
Yes, please. My dream is to eventually have that information as metadata in test comments so that an automated process can confirm that changes to tests don't suddenly make them pass in versions where they are supposed to fail. But that is way beyond the scope of this PR. :-) |
mcollina
commented
May 2, 2016
👍 on writing a comment stating on which node version this belongs to. |
alexjeffburke
commented
May 6, 2016
I'll look at adding those descriptive paragraphs - as for versioning, any objection to the following: // node version target: 0.12 |
alexjeffburke
commented
May 8, 2016
Just updated these two tests to address comments:
I also renamed consumeChunks() -> writeChunks() to better its behaviour. |
mcollina
commented
May 9, 2016
Apart for the two |
calvinmetcalf
commented
May 9, 2016
fyi I've got a shim working so I can run the readable streams (including the Buffer.from) against old node |
@mcollina@calvinmetcalf re It's easy enough to conditionally check for the Buffer method etc, but it's still unclear whether the in-tree tests should target the lowest version of node (thus compat glue be added in test) or if it is ok for this to be handled in the readable-streams repo. |
jasnell
commented
May 9, 2016
Given the requirement that readable-stream has to support older versions of Node I think not going with the Buffer.from() here is appropriate. |
calvinmetcalf
commented
May 9, 2016
sorry, to clarify this is handled in readable-stream already |
alexjeffburke
commented
May 11, 2016
Seems like I can leave the files as is with 'new Buffer()'. Given previous LGTMs, is there anything else I should do before these can be landed? |
jasnell
commented
May 11, 2016
LGTM if @nodejs/streams is good with it. |
yup it's good, merged |
alexjeffburke
commented
May 13, 2016
Awesome, thanks! Very glad this was useful. |
adds 2 new tests for streams3 cork behavior, cork then uncork and cork then end PR-URL: #6493 Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins
commented
Jun 2, 2016
@nodejs/streams should this be backported to v4? |
@thealphanerd Ideally yes, if it is not passing ping us. |
adds 2 new tests for streams3 cork behavior, cork then uncork and cork then end PR-URL: #6493 Reviewed-By: James M Snell <jasnell@gmail.com>
adds 2 new tests for streams3 cork behavior, cork then uncork and cork then end PR-URL: #6493 Reviewed-By: James M Snell <jasnell@gmail.com>
adds 2 new tests for streams3 cork behavior, cork then uncork and cork then end PR-URL: #6493 Reviewed-By: James M Snell <jasnell@gmail.com>
adds 2 new tests for streams3 cork behavior, cork then uncork and cork then end PR-URL: #6493 Reviewed-By: James M Snell <jasnell@gmail.com>
adds 2 new tests for streams3 cork behavior, cork then uncork and cork then end PR-URL: #6493 Reviewed-By: James M Snell <jasnell@gmail.com>
adds 2 new tests for streams3 cork behavior, cork then uncork and cork then end PR-URL: #6493 Reviewed-By: James M Snell <jasnell@gmail.com>
Checklist
Description of change
Add tests of stream3 the buffering behaviour of cork() followed by uncork()/end(). Opening a PR for review per request of the streams-wg.
cc @nodejs/readable-stream