Skip to content

Commit

Permalink
build: try to use 127.0.0.1 directly in the tests [skip appveyor] [sk…
Browse files Browse the repository at this point in the history
…ip circleci]
  • Loading branch information
JCMais committed Dec 24, 2024
1 parent f3c0aa5 commit 7e6ae9e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 3 additions & 0 deletions scripts/ci/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,9 @@ else
ldd ./lib/binding/node_libcurl.node || true
fi

echo "Showing /etc/hosts"
cat /etc/hosts || true

if [ "$RUN_TESTS" == "true" ]; then
if [ -n "$ELECTRON_VERSION" ]; then
[ $run_tests_electron == "true" ] && yarn test:electron || echo "Tests for this version of electron were disabled"
Expand Down
2 changes: 0 additions & 2 deletions test/curl/http2.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ const onSession: OnSessionFn = (_session) => {
session = _session
}
const onStream: OnStreamFn = (stream, _headers) => {
console.log('Received headers:', _headers)
stream.respond({
'content-type': 'text/html',
':status': 200,
Expand All @@ -45,7 +44,6 @@ describe('HTTP2', () => {
serverInstance.server.on('session', onSession)
serverInstance.server.on('stream', onStream)
await serverInstance.listen()
console.log(serverInstance.url)
})

afterAll(async () => {
Expand Down
4 changes: 2 additions & 2 deletions test/helper/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { AddressInfo } from 'net'
import express from 'express'
import cookieParser from 'cookie-parser'

const host = 'localhost'
const host = '127.0.0.1'

const file = path.resolve.bind(this, __dirname)
const key = fs.readFileSync(file('./ssl/cert.key'))
Expand Down Expand Up @@ -64,7 +64,7 @@ function _createServer<

const listen = () => {
return new Promise<number>((resolve) => {
server.listen(0, 'localhost', () => {
server.listen(0, '127.0.0.1', () => {
const address = server.address() as AddressInfo
port = address.port
resolve(port)
Expand Down

0 comments on commit 7e6ae9e

Please sign in to comment.