Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: check the pipeline AbortSignal reason is propagated
Browse files Browse the repository at this point in the history
marvinroger committed Oct 20, 2024
1 parent b309f21 commit 8feb3f6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/parallel/test-stream-pipeline.js
Original file line number Diff line number Diff line change
@@ -1344,12 +1344,13 @@ tmpdir.refresh();

{
const ac = new AbortController();
const reason = new Error('Reason');
const r = Readable.from(async function* () {
for (let i = 0; i < 10; i++) {
await Promise.resolve();
yield String(i);
if (i === 5) {
ac.abort();
ac.abort(reason);
}
}
}());
@@ -1362,6 +1363,7 @@ tmpdir.refresh();
});
const cb = common.mustCall((err) => {
assert.strictEqual(err.name, 'AbortError');
assert.strictEqual(err.cause, reason);
assert.strictEqual(res, '012345');
assert.strictEqual(w.destroyed, true);
assert.strictEqual(r.destroyed, true);

0 comments on commit 8feb3f6

Please sign in to comment.