Re: [whatwg/streams] Rigorously specify and test pipeTo (#512)

> Hmm. Given that only one flag can be used in any given pipeTo, I'm not sure how valuable this would be. Could you give an example of what you'd be hoping to test?

E.g. please try simply adding `preventCancel: true` to the `Errors must be propagated forward: starts errored; preventAbort = ${String(truthy)} (truthy)` test in `error-propagation-forward.js` and see how many times `shutdown()` is invoked. It's invoked twice and `finalize()` is also invoked twice. The second `finalize()` fails harmlessly on the redundant call of WritableStreamDefaultWriterRelease() which throws. It's not affecting the publicly visible behavior, but I think we should suppress the redundant invocation of `finalize()`.

That's the background of my comment at https://github.com/whatwg/streams/pull/512#discussion_r83581051.

In general, I think it's worth testing some cases where two or three of prevent.* flags are set to a truthy value (though no need to have full coverage) as it's possible and should be common to do so, in addition to what you've done which is, of course, needed and important.

> Although, I guess I just realized we do not have any tests for multiple close/error conditions being true at once :(. So e.g. piping a closed readable stream to an errored writable stream and so on. The spec isn't even super clear about what takes precedence there. I guess that's another reasonably large chunk of work to do. I'll try to do it Monday.

Agreed.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/pull/512#issuecomment-255706022

Received on Monday, 24 October 2016 10:37:10 UTC