Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Commit 24679af

Browse files
author
Alan Shaw
authored
fix: use ephemeral ports in API/Gateway bind test (#2305)
Observed to frequently fail on windows in CI due to hard coded ports in use. License: MIT Signed-off-by: Alan Shaw <[email protected]>
1 parent 3583cc2 commit 24679af

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

test/cli/daemon.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,13 @@ describe('daemon', () => {
9696
this.timeout(20 * 1000)
9797

9898
const apiAddrs = [
99-
'/ip4/127.0.0.1/tcp/55001',
100-
'/ip4/127.0.0.1/tcp/55002'
99+
'/ip4/127.0.0.1/tcp/0',
100+
'/dns4/localhost/tcp/0'
101101
]
102102

103103
const gatewayAddrs = [
104-
'/ip4/127.0.0.1/tcp/64080',
105-
'/ip4/127.0.0.1/tcp/64081'
104+
'/ip4/127.0.0.1/tcp/0',
105+
'/dns4/localhost/tcp/0'
106106
]
107107

108108
await ipfs('init')
@@ -124,8 +124,8 @@ describe('daemon', () => {
124124
})
125125
})
126126

127-
apiAddrs.forEach(addr => expect(out).to.include(`API listening on ${addr}`))
128-
gatewayAddrs.forEach(addr => expect(out).to.include(`Gateway (read only) listening on ${addr}`))
127+
apiAddrs.forEach(addr => expect(out).to.include(`API listening on ${addr.slice(0, -2)}`))
128+
gatewayAddrs.forEach(addr => expect(out).to.include(`Gateway (read only) listening on ${addr.slice(0, -2)}`))
129129
})
130130

131131
it('should allow no bind addresses for API and Gateway', async function () {

0 commit comments

Comments
 (0)