Skip to content

Commit 34f688f

Browse files
sync: update CI config files (libp2p#232)
* update .github/workflows/js-test-and-release.yml * test: fix tests on node 18 (libp2p#234) We need to specify the host name to connect. If we don't it defaults to `localhost` - it seems in node 17+ DNS resolution has changed to return IPv6 addresses by default which causes the connection to fail because the listener has only bound to an IPv4 address. Co-authored-by: web3-bot <[email protected]> Co-authored-by: Alex Potsides <[email protected]>
1 parent 609c9b8 commit 34f688f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

.github/workflows/js-test-and-release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
strategy:
2828
matrix:
2929
os: [windows-latest, ubuntu-latest, macos-latest]
30-
node: [16]
30+
node: [lts/*]
3131
fail-fast: true
3232
steps:
3333
- uses: actions/checkout@v3

test/max-connections.spec.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ describe('maxConnections', () => {
1818
const port = 9900
1919

2020
const seenRemoteConnections = new Set<string>()
21-
const trasnport = tcp({ maxConnections })()
21+
const transport = tcp({ maxConnections })()
2222

2323
const upgrader = mockUpgrader()
24-
const listener = trasnport.createListener({ upgrader })
24+
const listener = transport.createListener({ upgrader })
2525
// eslint-disable-next-line @typescript-eslint/promise-function-async
2626
afterEachCallbacks.push(() => listener.close())
2727
await listener.listen(multiaddr(`/ip4/127.0.0.1/tcp/${port}`))
@@ -33,7 +33,7 @@ describe('maxConnections', () => {
3333
const sockets: net.Socket[] = []
3434

3535
for (let i = 0; i < socketCount; i++) {
36-
const socket = net.connect({ port })
36+
const socket = net.connect({ host: '127.0.0.1', port })
3737
sockets.push(socket)
3838

3939
// eslint-disable-next-line @typescript-eslint/promise-function-async

0 commit comments

Comments
 (0)