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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: fix failing tests #2097

Merged
merged 9 commits into from
May 1, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test: fixes
  • Loading branch information
KhafraDev committed Apr 26, 2023
commit 5a452f8dd41ce668d625a3ce10a7bca836d78442
6 changes: 3 additions & 3 deletions test/connect-timeout.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ const sleep = require('atomic-sleep')
test('priotorise socket errors over timeouts', (t) => {
t.plan(1)
const connectTimeout = 1000
const client = new Pool('http:https://foobar.bar:1234', { connectTimeout })
const client = new Pool('http:https://foobar.bar:1234', { connectTimeout: 1 })

client.request({ method: 'GET', path: '/foobar' })
.then(() => t.fail())
.catch((err) => {
t.equal(err.code, 'ENOTFOUND')
})

// block for 2s which is enough for the dns lookup to complete and TO to fire
sleep(connectTimeout * 2)
// block for 1s which is enough for the dns lookup to complete and TO to fire
sleep(connectTimeout)
})

// never connect
Expand Down
4 changes: 3 additions & 1 deletion test/fetch/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

'use strict'

const { test } = require('tap')
const { test, teardown } = require('tap')
const {
Request,
Headers,
Expand Down Expand Up @@ -475,3 +475,5 @@ test('set-cookie headers get cleared when passing a Request as first param', (t)
t.same(req2.headers.getSetCookie(), [])
t.end()
})

teardown(() => process.exit())