Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Streams: tests for
Transformer.cancel
#40453Streams: tests for
Transformer.cancel
#40453Changes from 4 commits
ff3c698
4156716
1f2f6c8
1fbae6a
9fa9a0c
ab3f840
a169eb4
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I see. Since
TransformStreamDefaultSourceCancelAlgorithm
takes at least one microtask to runtransformer.cancel()
(even if it does not exist), theTypeError
fromterminate()
now wins the race. 🤔I suppose that's fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hello @MattiasBuelens i am trying to implement this for node this test presently fails my knowledge of WPTs is little limited hence asking here so is
cancelPromise
also expected to throw in this test? I am seeing that running this test standalone throws TypeError but unable to understand why the WPT says this uncaughtThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test will fail if you have not implanted the changes from the streams spec PR (yet).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test passes against the reference implementation, so if it fails it may be a bug in your implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be a bug no doubt i just wnated to know this test is basically equalt to the following script right:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@debadree25 Yes, that looks script right. Ideally, you want to assert that the
TypeError
originates from.closed
and not fromcancelPromise
, so in Node you could use assert.rejects():No,
cancelPromise
should always resolve.The only change is that
writer.closed
now becomes errored bycontroller.terminate()
, whereas previously it would be errored byts.readable.cancel(cancelReason)
. This is becausereadable.cancel()
now needs to go through the (possibly asynchronous)transformer.cancel()
method first before it can error the writable, whereascontroller.terminate()
always errors the writable synchronously (without going through a transformer method).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much @MattiasBuelens for the detail response i guess i have found the issue with my implementation!