Version
main
Platform
Subsystem
stream
What steps will reproduce the bug?
import{push}from'node:stream/iter';asyncfunctionrepro(label,abortBeforeEnd){const{ writer, readable }=push();awaitwriter.write('x');constcontroller=newAbortController();if(abortBeforeEnd)controller.abort(newError('stop'));constending=writer.end({signal: controller.signal}).then((bytes)=>`resolved: ${bytes}`,(error)=>`rejected: ${error.message}`,);if(!abortBeforeEnd)controller.abort(newError('stop'));constdraining=(async()=>{forawait(constchunkofreadable){voidchunk;}})();console.log(`${label}: ${awaitending}`);awaitdraining;}awaitrepro('pre-aborted',true);awaitrepro('aborted while draining',false);How often does it reproduce? Is there a required condition?
Always
What is the expected behavior? Why is that the expected behavior?
it should reject with the signal’s abort reason in both cases.
What do you see instead?
pre-aborted: resolved: 1aborted while draining: resolved: 1
end() resolves successfully whether the signal is already aborted or becomes aborted while the buffered data is draining.
Additional information
No response
Version
main
Platform
Subsystem
stream
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior? Why is that the expected behavior?
it should reject with the signal’s abort reason in both cases.
What do you see instead?
end()resolves successfully whether the signal is already aborted or becomes aborted while the buffered data is draining.Additional information
No response