Skip to content

[Streams] Add a test for piping to errored - #12296

Merged
ricea merged 3 commits into
web-platform-tests:masterfrom
ricea:streams-piping-to-errored
Aug 10, 2018
Merged

ricea merged 3 commits into
web-platform-tests:masterfrom
ricea:streams-piping-to-errored

Conversation

@ricea

@ricea ricea commented Aug 3, 2018

Copy link
Copy Markdown
Contributor

The test 'Piping from an errored readable stream to an errored writable
stream' was misnamed, as the destination writable was erroring, not
errored. Rename it. Add a variant of the test where pipeTo() isn't
called until the destination is errored.

The test 'Piping from an errored readable stream to an errored writable
stream' was misnamed, as the destination writable was erroring, not
errored. Rename it. Add a variant of the test where pipeTo() isn't
called until the destination is errored.

@domenic domenic left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with potential improvement.

Comment thread streams/piping/multiple-propagation.js Outdated
});

// Trying to abort a stream that was errored will give that error back
return Promise.resolve()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test might be more obviously correct if you checked the errored state of ws before doing the piping, instead of checking it at the end.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. I also split a couple more tests into erroring / errored variants, although in these cases the asserts don't change. PTAL.

ricea added 2 commits August 6, 2018 21:57
Explicitly wait for the writable to be errored. This is clearer than
implicitly waiting via Promise.resolve().

Also split more tests into erroring + errored.

@domenic domenic left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice. Will let you squash and merge, or rebase and merge, as desired.

@ricea
ricea merged commit 8ab7aac into web-platform-tests:master Aug 10, 2018
@ricea
ricea deleted the streams-piping-to-errored branch August 10, 2018 05:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants