Skip to content
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

feat: add DNS interceptor #3490

Merged
merged 17 commits into from
Sep 26, 2024
Prev Previous commit
Next Next commit
fix: tests
  • Loading branch information
metcoder95 committed Sep 11, 2024
commit 9b01a0985ccb8f6fc0d623ff4b2b3f95484c1493
4 changes: 2 additions & 2 deletions test/interceptors/dns.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@

const promise = client.request({
...requestOptions,
origin: 'http://localhost'
origin: 'http://localhost:1234'
})

await t.rejects(promise, 'ECONNREFUSED')
Expand Down Expand Up @@ -577,7 +577,7 @@
t.equal(response.statusCode, 200)
t.equal(await response.body.text(), 'hello world!')

await sleep(200)
await sleep(500)

const response2 = await client.request({
...requestOptions,
Expand All @@ -586,7 +586,7 @@

t.equal(response2.statusCode, 200)
t.equal(await response2.body.text(), 'hello world!')
t.equal(lookupCounter, 2)

Check failure on line 589 in test/interceptors/dns.js

View workflow job for this annotation

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

Should we handle TTL (4)

[Error [ERR_TEST_FAILURE]: 1 == 2] { code: 'ERR_TEST_FAILURE', failureType: 'testCodeFailure', cause: AssertionError [ERR_ASSERTION]: 1 == 2 at res.<computed> [as equal] (/home/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35) at TestContext.<anonymous> (/home/runner/work/undici/undici/test/interceptors/dns.js:589:5) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Test.run (node:internal/test_runner/test:790:9) at async Test.processPendingSubtests (node:internal/test_runner/test:517:7) { generatedMessage: true, code: 'ERR_ASSERTION', actual: 1, expected: 2, operator: '==' } }

Check failure on line 589 in test/interceptors/dns.js

View workflow job for this annotation

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

Should we handle TTL (4)

[Error [ERR_TEST_FAILURE]: 1 == 2] { code: 'ERR_TEST_FAILURE', failureType: 'testCodeFailure', cause: AssertionError [ERR_ASSERTION]: 1 == 2 at res.<computed> [as equal] (/home/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35) at TestContext.<anonymous> (/home/runner/work/undici/undici/test/interceptors/dns.js:589:5) at process.processTicksAndRejections (node:internal/process/task_queues:105:5) at async Test.run (node:internal/test_runner/test:888:9) at async Test.processPendingSubtests (node:internal/test_runner/test:584:7) { generatedMessage: true, code: 'ERR_ASSERTION', actual: 1, expected: 2, operator: '==' } }

Check failure on line 589 in test/interceptors/dns.js

View workflow job for this annotation

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

Should we handle TTL (4)

[Error [ERR_TEST_FAILURE]: 1 == 2] { code: 'ERR_TEST_FAILURE', failureType: 'testCodeFailure', cause: AssertionError [ERR_ASSERTION]: 1 == 2 at res.<computed> [as equal] (/home/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35) at TestContext.<anonymous> (/home/runner/work/undici/undici/test/interceptors/dns.js:589:5) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Test.run (node:internal/test_runner/test:640:9) at async Test.processPendingSubtests (node:internal/test_runner/test:382:7) { generatedMessage: true, code: 'ERR_ASSERTION', actual: 1, expected: 2, operator: '==' } }

Check failure on line 589 in test/interceptors/dns.js

View workflow job for this annotation

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

Should we handle TTL (4)

[Error [ERR_TEST_FAILURE]: 1 == 2] { failureType: 'testCodeFailure', cause: AssertionError [ERR_ASSERTION]: 1 == 2 at res.<computed> [as equal] (/home/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35) at TestContext.<anonymous> (/home/runner/work/undici/undici/test/interceptors/dns.js:589:5) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Test.run (node:internal/test_runner/test:632:9) at async Test.processPendingSubtests (node:internal/test_runner/test:374:7) { generatedMessage: true, code: 'ERR_ASSERTION', actual: 1, expected: 2, operator: '==' }, code: 'ERR_TEST_FAILURE' }

Check failure on line 589 in test/interceptors/dns.js

View workflow job for this annotation

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

Should we handle TTL (4)

[Error [ERR_TEST_FAILURE]: 1 == 2] { code: 'ERR_TEST_FAILURE', failureType: 'testCodeFailure', cause: AssertionError [ERR_ASSERTION]: 1 == 2 at res.<computed> [as equal] (/home/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35) at TestContext.<anonymous> (/home/runner/work/undici/undici/test/interceptors/dns.js:589:5) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Test.run (node:internal/test_runner/test:790:9) at async Test.processPendingSubtests (node:internal/test_runner/test:517:7) { generatedMessage: true, code: 'ERR_ASSERTION', actual: 1, expected: 2, operator: '==' } }

Check failure on line 589 in test/interceptors/dns.js

View workflow job for this annotation

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

Should we handle TTL (4)

[Error [ERR_TEST_FAILURE]: 1 == 2] { code: 'ERR_TEST_FAILURE', failureType: 'testCodeFailure', cause: AssertionError [ERR_ASSERTION]: 1 == 2 at res.<computed> [as equal] (/home/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35) at TestContext.<anonymous> (/home/runner/work/undici/undici/test/interceptors/dns.js:589:5) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Test.run (node:internal/test_runner/test:640:9) at async Test.processPendingSubtests (node:internal/test_runner/test:382:7) { generatedMessage: true, code: 'ERR_ASSERTION', actual: 1, expected: 2, operator: '==' } }

Check failure on line 589 in test/interceptors/dns.js

View workflow job for this annotation

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

Should we handle TTL (4)

[Error [ERR_TEST_FAILURE]: 1 == 2] { code: 'ERR_TEST_FAILURE', failureType: 'testCodeFailure', cause: AssertionError [ERR_ASSERTION]: 1 == 2 at res.<computed> [as equal] (/home/runner/work/undici/undici/node_modules/@matteo.collina/tspl/tspl.js:52:35) at TestContext.<anonymous> (/home/runner/work/undici/undici/test/interceptors/dns.js:589:5) at process.processTicksAndRejections (node:internal/process/task_queues:105:5) at async Test.run (node:internal/test_runner/test:888:9) at async Test.processPendingSubtests (node:internal/test_runner/test:584:7) { generatedMessage: true, code: 'ERR_ASSERTION', actual: 1, expected: 2, operator: '==' } }
})

test('Should we handle TTL (6)', async t => {
Expand Down
Loading