AbortController: integrate with stream piping. (#37244)

Start using abort signal in Use in
https://streams.spec.whatwg.org/#readablestream-pipe-to-signal

Part of https://github.com/servo/servo/issues/34866

Will also cover https://github.com/servo/servo/issues/37230 and
https://github.com/servo/servo/issues/37232

---------

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
This commit is contained in:
Gregory Terzian 2025-06-13 16:52:38 +07:00 committed by GitHub
parent 099fd10317
commit 730fe35b42
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 508 additions and 263 deletions

View file

@ -1,3 +1,4 @@
prefs: [dom_abort_controller_enabled:true]
[abort.https.any.shadowrealm-in-serviceworker.html]
expected: ERROR
@ -5,103 +6,9 @@
expected: ERROR
[abort.any.html]
expected: ERROR
[a signal argument 'null' should cause pipeTo() to reject]
expected: FAIL
[a signal argument 'AbortSignal' should cause pipeTo() to reject]
expected: FAIL
[a signal argument 'true' should cause pipeTo() to reject]
expected: FAIL
[a signal argument '-1' should cause pipeTo() to reject]
expected: FAIL
[a signal argument '[object AbortSignal\]' should cause pipeTo() to reject]
expected: FAIL
[an aborted signal should cause the writable stream to reject with an AbortError]
expected: FAIL
[(reason: 'null') all the error objects should be the same object]
expected: FAIL
[(reason: 'undefined') all the error objects should be the same object]
expected: FAIL
[(reason: 'error1: error1') all the error objects should be the same object]
expected: FAIL
[preventCancel should prevent canceling the readable]
expected: FAIL
[preventAbort should prevent aborting the readable]
expected: FAIL
[preventCancel and preventAbort should prevent canceling the readable and aborting the readable]
expected: FAIL
[(reason: 'null') abort should prevent further reads]
expected: FAIL
[(reason: 'undefined') abort should prevent further reads]
expected: FAIL
[(reason: 'error1: error1') abort should prevent further reads]
expected: FAIL
[(reason: 'null') all pending writes should complete on abort]
expected: FAIL
[(reason: 'undefined') all pending writes should complete on abort]
expected: FAIL
[(reason: 'error1: error1') all pending writes should complete on abort]
expected: FAIL
[(reason: 'null') underlyingSource.cancel() should called when abort, even with pending pull]
expected: FAIL
[(reason: 'undefined') underlyingSource.cancel() should called when abort, even with pending pull]
expected: FAIL
[(reason: 'error1: error1') underlyingSource.cancel() should called when abort, even with pending pull]
expected: FAIL
[a rejection from underlyingSource.cancel() should be returned by pipeTo()]
expected: FAIL
[a rejection from underlyingSink.abort() should be returned by pipeTo()]
expected: FAIL
[a rejection from underlyingSink.abort() should be preferred to one from underlyingSource.cancel()]
expected: FAIL
[abort signal takes priority over closed readable]
expected: FAIL
[abort signal takes priority over errored readable]
expected: FAIL
[abort signal takes priority over closed writable]
expected: FAIL
[abort signal takes priority over errored writable]
expected: FAIL
[abort should do nothing after the readable is closed]
expected: FAIL
[abort should do nothing after the readable is errored]
expected: FAIL
[abort should do nothing after the readable is errored, even with pending writes]
expected: FAIL
[abort should do nothing after the writable is errored]
expected: FAIL
[pipeTo on a teed readable byte stream should only be aborted when both branches are aborted]
expected: FAIL
@ -119,103 +26,9 @@
expected: ERROR
[abort.any.worker.html]
expected: ERROR
[a signal argument 'null' should cause pipeTo() to reject]
expected: FAIL
[a signal argument 'AbortSignal' should cause pipeTo() to reject]
expected: FAIL
[a signal argument 'true' should cause pipeTo() to reject]
expected: FAIL
[a signal argument '-1' should cause pipeTo() to reject]
expected: FAIL
[a signal argument '[object AbortSignal\]' should cause pipeTo() to reject]
expected: FAIL
[an aborted signal should cause the writable stream to reject with an AbortError]
expected: FAIL
[(reason: 'null') all the error objects should be the same object]
expected: FAIL
[(reason: 'undefined') all the error objects should be the same object]
expected: FAIL
[(reason: 'error1: error1') all the error objects should be the same object]
expected: FAIL
[preventCancel should prevent canceling the readable]
expected: FAIL
[preventAbort should prevent aborting the readable]
expected: FAIL
[preventCancel and preventAbort should prevent canceling the readable and aborting the readable]
expected: FAIL
[(reason: 'null') abort should prevent further reads]
expected: FAIL
[(reason: 'undefined') abort should prevent further reads]
expected: FAIL
[(reason: 'error1: error1') abort should prevent further reads]
expected: FAIL
[(reason: 'null') all pending writes should complete on abort]
expected: FAIL
[(reason: 'undefined') all pending writes should complete on abort]
expected: FAIL
[(reason: 'error1: error1') all pending writes should complete on abort]
expected: FAIL
[(reason: 'null') underlyingSource.cancel() should called when abort, even with pending pull]
expected: FAIL
[(reason: 'undefined') underlyingSource.cancel() should called when abort, even with pending pull]
expected: FAIL
[(reason: 'error1: error1') underlyingSource.cancel() should called when abort, even with pending pull]
expected: FAIL
[a rejection from underlyingSource.cancel() should be returned by pipeTo()]
expected: FAIL
[a rejection from underlyingSink.abort() should be returned by pipeTo()]
expected: FAIL
[a rejection from underlyingSink.abort() should be preferred to one from underlyingSource.cancel()]
expected: FAIL
[abort signal takes priority over closed readable]
expected: FAIL
[abort signal takes priority over errored readable]
expected: FAIL
[abort signal takes priority over closed writable]
expected: FAIL
[abort signal takes priority over errored writable]
expected: FAIL
[abort should do nothing after the readable is closed]
expected: FAIL
[abort should do nothing after the readable is errored]
expected: FAIL
[abort should do nothing after the readable is errored, even with pending writes]
expected: FAIL
[abort should do nothing after the writable is errored]
expected: FAIL
[pipeTo on a teed readable byte stream should only be aborted when both branches are aborted]
expected: FAIL

View file

@ -20,22 +20,8 @@
expected: ERROR
[throwing-options.any.html]
expected: TIMEOUT
[pipeTo should stop after getting signal throws]
expected: TIMEOUT
[pipeThrough should stop after getting signal throws]
expected: FAIL
[throwing-options.any.worker.html]
expected: TIMEOUT
[pipeTo should stop after getting signal throws]
expected: TIMEOUT
[pipeThrough should stop after getting signal throws]
expected: FAIL
[throwing-options.any.sharedworker.html]
expected: ERROR