Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
tsctx committed Oct 28, 2024
1 parent bc34174 commit 5149e0d
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions test/fetch/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,8 @@ test('pre aborted signal', () => {
assert.strictEqual(req.signal.reason, 'gwak')
})

test('post aborted signal', (t) => {
const { strictEqual } = tspl(t, { plan: 2 })
test('post aborted signal', async (t) => {
const { strictEqual, completed } = tspl(t, { plan: 2 })

const ac = new AbortController()
const req = new Request('http://asd', { signal: ac.signal })
Expand All @@ -272,6 +272,8 @@ test('post aborted signal', (t) => {
strictEqual(req.signal.reason, 'gwak')

Check failure on line 272 in test/fetch/request.js

View workflow job for this annotation

GitHub Actions / test (20, ubuntu-latest) / Test with Node.js 20 on ubuntu-latest

post aborted signal

Error [ERR_TEST_FAILURE]: Expected values to be strictly equal: + actual - expected + undefined - 'gwak' at process.emit (node:events:519:28) { code: 'ERR_TEST_FAILURE', failureType: 'uncaughtException', cause: AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: + actual - expected + undefined - 'gwak' at res.<computed> (/home/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35) at ac.signal.addEventListener.once (/home/runner/work/undici/undici/test/fetch/request.js:272:5) at [nodejs.internal.kHybridDispatch] (node:internal/event_target:820:20) at EventTarget.dispatchEvent (node:internal/event_target:755:26) at abortSignal (node:internal/abort_controller:370:10) at AbortController.abort (node:internal/abort_controller:392:5) at TestContext.<anonymous> (/home/runner/work/undici/undici/test/fetch/request.js:274:6) at Test.runInAsyncScope (node:async_hooks:206:9) at Test.run (node:internal/test_runner/test:796:25) at Test.processPendingSubtests (node:internal/test_runner/test:527:18) { generatedMessage: true, code: 'ERR_ASSERTION', actual: undefined, expected: 'gwak', operator: 'strictEqual' } }

Check failure on line 272 in test/fetch/request.js

View workflow job for this annotation

GitHub Actions / test (21, ubuntu-latest) / Test with Node.js 21 on ubuntu-latest

post aborted signal

Error [ERR_TEST_FAILURE]: Expected values to be strictly equal: + actual - expected + undefined - 'gwak' at process.emit (node:events:519:28) { code: 'ERR_TEST_FAILURE', failureType: 'uncaughtException', cause: AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: + actual - expected + undefined - 'gwak' at res.<computed> (/home/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35) at ac.signal.addEventListener.once (/home/runner/work/undici/undici/test/fetch/request.js:272:5) at [nodejs.internal.kHybridDispatch] (node:internal/event_target:822:20) at EventTarget.dispatchEvent (node:internal/event_target:757:26) at abortSignal (node:internal/abort_controller:374:10) at AbortController.abort (node:internal/abort_controller:396:5) at TestContext.<anonymous> (/home/runner/work/undici/undici/test/fetch/request.js:274:6) at Test.runInAsyncScope (node:async_hooks:206:9) at Test.run (node:internal/test_runner/test:639:25) at Test.processPendingSubtests (node:internal/test_runner/test:382:18) { generatedMessage: true, code: 'ERR_ASSERTION', actual: undefined, expected: 'gwak', operator: 'strictEqual' } }

Check failure on line 272 in test/fetch/request.js

View workflow job for this annotation

GitHub Actions / test (18, ubuntu-latest) / Test with Node.js 18 on ubuntu-latest

post aborted signal

Error [ERR_TEST_FAILURE]: Expected values to be strictly equal: + actual - expected + undefined - 'gwak' at process.emit (node:events:517:28) { failureType: 'uncaughtException', cause: AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: + actual - expected + undefined - 'gwak' at res.<computed> (/home/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35) at ac.signal.addEventListener.once (/home/runner/work/undici/undici/test/fetch/request.js:272:5) at [nodejs.internal.kHybridDispatch] (node:internal/event_target:786:20) at EventTarget.dispatchEvent (node:internal/event_target:721:26) at abortSignal (node:internal/abort_controller:369:10) at AbortController.abort (node:internal/abort_controller:403:5) at TestContext.<anonymous> (/home/runner/work/undici/undici/test/fetch/request.js:274:6) at Test.runInAsyncScope (node:async_hooks:203:9) at Test.run (node:internal/test_runner/test:631:25) at Test.processPendingSubtests (node:internal/test_runner/test:374:18) { generatedMessage: true, code: 'ERR_ASSERTION', actual: undefined, expected: 'gwak', operator: 'strictEqual' }, code: 'ERR_TEST_FAILURE' }

Check failure on line 272 in test/fetch/request.js

View workflow job for this annotation

GitHub Actions / Test with Node.js 20 compiled --without-intl

post aborted signal

Error [ERR_TEST_FAILURE]: Expected values to be strictly equal: + actual - expected + undefined - 'gwak' at process.emit (node:events:519:28) { code: 'ERR_TEST_FAILURE', failureType: 'uncaughtException', cause: AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: + actual - expected + undefined - 'gwak' at res.<computed> (/home/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35) at ac.signal.addEventListener.once (/home/runner/work/undici/undici/test/fetch/request.js:272:5) at [nodejs.internal.kHybridDispatch] (node:internal/event_target:820:20) at EventTarget.dispatchEvent (node:internal/event_target:755:26) at abortSignal (node:internal/abort_controller:370:10) at AbortController.abort (node:internal/abort_controller:392:5) at TestContext.<anonymous> (/home/runner/work/undici/undici/test/fetch/request.js:274:6) at Test.runInAsyncScope (node:async_hooks:206:9) at Test.run (node:internal/test_runner/test:796:25) at Test.processPendingSubtests (node:internal/test_runner/test:527:18) { generatedMessage: true, code: 'ERR_ASSERTION', actual: undefined, expected: 'gwak', operator: 'strictEqual' } }

Check failure on line 272 in test/fetch/request.js

View workflow job for this annotation

GitHub Actions / test (20, macos-latest) / Test with Node.js 20 on macos-latest

post aborted signal

Error [ERR_TEST_FAILURE]: Expected values to be strictly equal: + actual - expected + undefined - 'gwak' at process.emit (node:events:519:28) { code: 'ERR_TEST_FAILURE', failureType: 'uncaughtException', cause: AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: + actual - expected + undefined - 'gwak' at res.<computed> (/Users/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35) at ac.signal.addEventListener.once (/Users/runner/work/undici/undici/test/fetch/request.js:272:5) at [nodejs.internal.kHybridDispatch] (node:internal/event_target:820:20) at EventTarget.dispatchEvent (node:internal/event_target:755:26) at abortSignal (node:internal/abort_controller:370:10) at AbortController.abort (node:internal/abort_controller:392:5) at TestContext.<anonymous> (/Users/runner/work/undici/undici/test/fetch/request.js:274:6) at Test.runInAsyncScope (node:async_hooks:206:9) at Test.run (node:internal/test_runner/test:796:25) at Test.processPendingSubtests (node:internal/test_runner/test:527:18) { generatedMessage: true, code: 'ERR_ASSERTION', actual: undefined, expected: 'gwak', operator: 'strictEqual' } }

Check failure on line 272 in test/fetch/request.js

View workflow job for this annotation

GitHub Actions / test (21, macos-latest) / Test with Node.js 21 on macos-latest

post aborted signal

Error [ERR_TEST_FAILURE]: Expected values to be strictly equal: + actual - expected + undefined - 'gwak' at process.emit (node:events:519:28) { code: 'ERR_TEST_FAILURE', failureType: 'uncaughtException', cause: AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: + actual - expected + undefined - 'gwak' at res.<computed> (/Users/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35) at ac.signal.addEventListener.once (/Users/runner/work/undici/undici/test/fetch/request.js:272:5) at [nodejs.internal.kHybridDispatch] (node:internal/event_target:822:20) at EventTarget.dispatchEvent (node:internal/event_target:757:26) at abortSignal (node:internal/abort_controller:374:10) at AbortController.abort (node:internal/abort_controller:396:5) at TestContext.<anonymous> (/Users/runner/work/undici/undici/test/fetch/request.js:274:6) at Test.runInAsyncScope (node:async_hooks:206:9) at Test.run (node:internal/test_runner/test:639:25) at Test.processPendingSubtests (node:internal/test_runner/test:382:18) { generatedMessage: true, code: 'ERR_ASSERTION', actual: undefined, expected: 'gwak', operator: 'strictEqual' } }

Check failure on line 272 in test/fetch/request.js

View workflow job for this annotation

GitHub Actions / Test with Node.js 21 compiled --without-intl

post aborted signal

Error [ERR_TEST_FAILURE]: Expected values to be strictly equal: + actual - expected + undefined - 'gwak' at process.emit (node:events:519:28) { code: 'ERR_TEST_FAILURE', failureType: 'uncaughtException', cause: AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: + actual - expected + undefined - 'gwak' at res.<computed> (/home/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35) at ac.signal.addEventListener.once (/home/runner/work/undici/undici/test/fetch/request.js:272:5) at [nodejs.internal.kHybridDispatch] (node:internal/event_target:822:20) at EventTarget.dispatchEvent (node:internal/event_target:757:26) at abortSignal (node:internal/abort_controller:374:10) at AbortController.abort (node:internal/abort_controller:396:5) at TestContext.<anonymous> (/home/runner/work/undici/undici/test/fetch/request.js:274:6) at Test.runInAsyncScope (node:async_hooks:206:9) at Test.run (node:internal/test_runner/test:639:25) at Test.processPendingSubtests (node:internal/test_runner/test:382:18) { generatedMessage: true, code: 'ERR_ASSERTION', actual: undefined, expected: 'gwak', operator: 'strictEqual' } }

Check failure on line 272 in test/fetch/request.js

View workflow job for this annotation

GitHub Actions / test (18, macos-latest) / Test with Node.js 18 on macos-latest

post aborted signal

Error [ERR_TEST_FAILURE]: Expected values to be strictly equal: + actual - expected + undefined - 'gwak' at process.emit (node:events:517:28) { failureType: 'uncaughtException', cause: AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: + actual - expected + undefined - 'gwak' at res.<computed> (/Users/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35) at ac.signal.addEventListener.once (/Users/runner/work/undici/undici/test/fetch/request.js:272:5) at [nodejs.internal.kHybridDispatch] (node:internal/event_target:786:20) at EventTarget.dispatchEvent (node:internal/event_target:721:26) at abortSignal (node:internal/abort_controller:369:10) at AbortController.abort (node:internal/abort_controller:403:5) at TestContext.<anonymous> (/Users/runner/work/undici/undici/test/fetch/request.js:274:6) at Test.runInAsyncScope (node:async_hooks:203:9) at Test.run (node:internal/test_runner/test:631:25) at Test.processPendingSubtests (node:internal/test_runner/test:374:18) { generatedMessage: true, code: 'ERR_ASSERTION', actual: undefined, expected: 'gwak', operator: 'strictEqual' }, code: 'ERR_TEST_FAILURE' }
}, { once: true })
ac.abort('gwak')

await completed
})

test('pre aborted signal cloned', () => {
Expand Down Expand Up @@ -303,8 +305,8 @@ test('URLSearchParams body with Headers object - issue #1407', async () => {
assert.strictEqual(await request.text(), 'abc=123')
})

test('post aborted signal cloned', (t) => {
const { strictEqual } = tspl(t, { plan: 2 })
test('post aborted signal cloned', async (t) => {
const { strictEqual, completed } = tspl(t, { plan: 2 })

const ac = new AbortController()
const req = new Request('http://asd', { signal: ac.signal }).clone()
Expand All @@ -313,6 +315,8 @@ test('post aborted signal cloned', (t) => {
strictEqual(req.signal.reason, 'gwak')

Check failure on line 315 in test/fetch/request.js

View workflow job for this annotation

GitHub Actions / test (20, ubuntu-latest) / Test with Node.js 20 on ubuntu-latest

post aborted signal cloned

Error [ERR_TEST_FAILURE]: Expected values to be strictly equal: + actual - expected + undefined - 'gwak' at process.emit (node:events:519:28) { code: 'ERR_TEST_FAILURE', failureType: 'uncaughtException', cause: AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: + actual - expected + undefined - 'gwak' at res.<computed> (/home/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35) at ac.signal.addEventListener.once (/home/runner/work/undici/undici/test/fetch/request.js:315:5) at [nodejs.internal.kHybridDispatch] (node:internal/event_target:820:20) at EventTarget.dispatchEvent (node:internal/event_target:755:26) at abortSignal (node:internal/abort_controller:370:10) at AbortController.abort (node:internal/abort_controller:392:5) at TestContext.<anonymous> (/home/runner/work/undici/undici/test/fetch/request.js:317:6) at Test.runInAsyncScope (node:async_hooks:206:9) at Test.run (node:internal/test_runner/test:796:25) at Test.processPendingSubtests (node:internal/test_runner/test:527:18) { generatedMessage: true, code: 'ERR_ASSERTION', actual: undefined, expected: 'gwak', operator: 'strictEqual' } }

Check failure on line 315 in test/fetch/request.js

View workflow job for this annotation

GitHub Actions / test (21, ubuntu-latest) / Test with Node.js 21 on ubuntu-latest

post aborted signal cloned

Error [ERR_TEST_FAILURE]: Expected values to be strictly equal: + actual - expected + undefined - 'gwak' at process.emit (node:events:519:28) { code: 'ERR_TEST_FAILURE', failureType: 'uncaughtException', cause: AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: + actual - expected + undefined - 'gwak' at res.<computed> (/home/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35) at ac.signal.addEventListener.once (/home/runner/work/undici/undici/test/fetch/request.js:315:5) at [nodejs.internal.kHybridDispatch] (node:internal/event_target:822:20) at EventTarget.dispatchEvent (node:internal/event_target:757:26) at abortSignal (node:internal/abort_controller:374:10) at AbortController.abort (node:internal/abort_controller:396:5) at TestContext.<anonymous> (/home/runner/work/undici/undici/test/fetch/request.js:317:6) at Test.runInAsyncScope (node:async_hooks:206:9) at Test.run (node:internal/test_runner/test:639:25) at Test.processPendingSubtests (node:internal/test_runner/test:382:18) { generatedMessage: true, code: 'ERR_ASSERTION', actual: undefined, expected: 'gwak', operator: 'strictEqual' } }

Check failure on line 315 in test/fetch/request.js

View workflow job for this annotation

GitHub Actions / test (18, ubuntu-latest) / Test with Node.js 18 on ubuntu-latest

post aborted signal cloned

Error [ERR_TEST_FAILURE]: Expected values to be strictly equal: + actual - expected + undefined - 'gwak' at process.emit (node:events:517:28) { failureType: 'uncaughtException', cause: AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: + actual - expected + undefined - 'gwak' at res.<computed> (/home/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35) at ac.signal.addEventListener.once (/home/runner/work/undici/undici/test/fetch/request.js:315:5) at [nodejs.internal.kHybridDispatch] (node:internal/event_target:786:20) at EventTarget.dispatchEvent (node:internal/event_target:721:26) at abortSignal (node:internal/abort_controller:369:10) at AbortController.abort (node:internal/abort_controller:403:5) at TestContext.<anonymous> (/home/runner/work/undici/undici/test/fetch/request.js:317:6) at Test.runInAsyncScope (node:async_hooks:203:9) at Test.run (node:internal/test_runner/test:631:25) at Test.processPendingSubtests (node:internal/test_runner/test:374:18) { generatedMessage: true, code: 'ERR_ASSERTION', actual: undefined, expected: 'gwak', operator: 'strictEqual' }, code: 'ERR_TEST_FAILURE' }

Check failure on line 315 in test/fetch/request.js

View workflow job for this annotation

GitHub Actions / Test with Node.js 20 compiled --without-intl

post aborted signal cloned

Error [ERR_TEST_FAILURE]: Expected values to be strictly equal: + actual - expected + undefined - 'gwak' at process.emit (node:events:519:28) { code: 'ERR_TEST_FAILURE', failureType: 'uncaughtException', cause: AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: + actual - expected + undefined - 'gwak' at res.<computed> (/home/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35) at ac.signal.addEventListener.once (/home/runner/work/undici/undici/test/fetch/request.js:315:5) at [nodejs.internal.kHybridDispatch] (node:internal/event_target:820:20) at EventTarget.dispatchEvent (node:internal/event_target:755:26) at abortSignal (node:internal/abort_controller:370:10) at AbortController.abort (node:internal/abort_controller:392:5) at TestContext.<anonymous> (/home/runner/work/undici/undici/test/fetch/request.js:317:6) at Test.runInAsyncScope (node:async_hooks:206:9) at Test.run (node:internal/test_runner/test:796:25) at Test.processPendingSubtests (node:internal/test_runner/test:527:18) { generatedMessage: true, code: 'ERR_ASSERTION', actual: undefined, expected: 'gwak', operator: 'strictEqual' } }

Check failure on line 315 in test/fetch/request.js

View workflow job for this annotation

GitHub Actions / test (20, macos-latest) / Test with Node.js 20 on macos-latest

post aborted signal cloned

Error [ERR_TEST_FAILURE]: Expected values to be strictly equal: + actual - expected + undefined - 'gwak' at process.emit (node:events:519:28) { code: 'ERR_TEST_FAILURE', failureType: 'uncaughtException', cause: AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: + actual - expected + undefined - 'gwak' at res.<computed> (/Users/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35) at ac.signal.addEventListener.once (/Users/runner/work/undici/undici/test/fetch/request.js:315:5) at [nodejs.internal.kHybridDispatch] (node:internal/event_target:820:20) at EventTarget.dispatchEvent (node:internal/event_target:755:26) at abortSignal (node:internal/abort_controller:370:10) at AbortController.abort (node:internal/abort_controller:392:5) at TestContext.<anonymous> (/Users/runner/work/undici/undici/test/fetch/request.js:317:6) at Test.runInAsyncScope (node:async_hooks:206:9) at Test.run (node:internal/test_runner/test:796:25) at Test.processPendingSubtests (node:internal/test_runner/test:527:18) { generatedMessage: true, code: 'ERR_ASSERTION', actual: undefined, expected: 'gwak', operator: 'strictEqual' } }

Check failure on line 315 in test/fetch/request.js

View workflow job for this annotation

GitHub Actions / test (21, macos-latest) / Test with Node.js 21 on macos-latest

post aborted signal cloned

Error [ERR_TEST_FAILURE]: Expected values to be strictly equal: + actual - expected + undefined - 'gwak' at process.emit (node:events:519:28) { code: 'ERR_TEST_FAILURE', failureType: 'uncaughtException', cause: AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: + actual - expected + undefined - 'gwak' at res.<computed> (/Users/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35) at ac.signal.addEventListener.once (/Users/runner/work/undici/undici/test/fetch/request.js:315:5) at [nodejs.internal.kHybridDispatch] (node:internal/event_target:822:20) at EventTarget.dispatchEvent (node:internal/event_target:757:26) at abortSignal (node:internal/abort_controller:374:10) at AbortController.abort (node:internal/abort_controller:396:5) at TestContext.<anonymous> (/Users/runner/work/undici/undici/test/fetch/request.js:317:6) at Test.runInAsyncScope (node:async_hooks:206:9) at Test.run (node:internal/test_runner/test:639:25) at Test.processPendingSubtests (node:internal/test_runner/test:382:18) { generatedMessage: true, code: 'ERR_ASSERTION', actual: undefined, expected: 'gwak', operator: 'strictEqual' } }

Check failure on line 315 in test/fetch/request.js

View workflow job for this annotation

GitHub Actions / Test with Node.js 21 compiled --without-intl

post aborted signal cloned

Error [ERR_TEST_FAILURE]: Expected values to be strictly equal: + actual - expected + undefined - 'gwak' at process.emit (node:events:519:28) { code: 'ERR_TEST_FAILURE', failureType: 'uncaughtException', cause: AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: + actual - expected + undefined - 'gwak' at res.<computed> (/home/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35) at ac.signal.addEventListener.once (/home/runner/work/undici/undici/test/fetch/request.js:315:5) at [nodejs.internal.kHybridDispatch] (node:internal/event_target:822:20) at EventTarget.dispatchEvent (node:internal/event_target:757:26) at abortSignal (node:internal/abort_controller:374:10) at AbortController.abort (node:internal/abort_controller:396:5) at TestContext.<anonymous> (/home/runner/work/undici/undici/test/fetch/request.js:317:6) at Test.runInAsyncScope (node:async_hooks:206:9) at Test.run (node:internal/test_runner/test:639:25) at Test.processPendingSubtests (node:internal/test_runner/test:382:18) { generatedMessage: true, code: 'ERR_ASSERTION', actual: undefined, expected: 'gwak', operator: 'strictEqual' } }

Check failure on line 315 in test/fetch/request.js

View workflow job for this annotation

GitHub Actions / test (18, macos-latest) / Test with Node.js 18 on macos-latest

post aborted signal cloned

Error [ERR_TEST_FAILURE]: Expected values to be strictly equal: + actual - expected + undefined - 'gwak' at process.emit (node:events:517:28) { failureType: 'uncaughtException', cause: AssertionError [ERR_ASSERTION]: Expected values to be strictly equal: + actual - expected + undefined - 'gwak' at res.<computed> (/Users/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35) at ac.signal.addEventListener.once (/Users/runner/work/undici/undici/test/fetch/request.js:315:5) at [nodejs.internal.kHybridDispatch] (node:internal/event_target:786:20) at EventTarget.dispatchEvent (node:internal/event_target:721:26) at abortSignal (node:internal/abort_controller:369:10) at AbortController.abort (node:internal/abort_controller:403:5) at TestContext.<anonymous> (/Users/runner/work/undici/undici/test/fetch/request.js:317:6) at Test.runInAsyncScope (node:async_hooks:203:9) at Test.run (node:internal/test_runner/test:631:25) at Test.processPendingSubtests (node:internal/test_runner/test:374:18) { generatedMessage: true, code: 'ERR_ASSERTION', actual: undefined, expected: 'gwak', operator: 'strictEqual' }, code: 'ERR_TEST_FAILURE' }
}, { once: true })
ac.abort('gwak')

await completed
})

test('Passing headers in init', async (t) => {
Expand Down

0 comments on commit 5149e0d

Please sign in to comment.