Skip to content

Commit

Permalink
chore: fix ping tests
Browse files Browse the repository at this point in the history
The ping tests run over transient connections which can hit relay
limits.

Instead listen on tcp connections so the tests only run over direct
connections.
  • Loading branch information
achingbrain committed Nov 7, 2023
1 parent b8c2bf4 commit bd40d59
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion packages/libp2p/test/ping/ping.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,42 @@ import { createBaseOptions } from '../fixtures/base-options.js'
import { createNode, populateAddressBooks } from '../fixtures/creators/peer.js'
import type { Libp2p } from '@libp2p/interface'

describe('ping', () => {
describe.only('ping', () => {
let nodes: Array<Libp2p<{ ping: PingService }>>

beforeEach(async () => {
nodes = await Promise.all([
createNode({
config: createBaseOptions({
addresses: {
listen: [
'/ip4/0.0.0.0/tcp/0'
]
},
services: {
ping: pingService()
}
})
}),
createNode({
config: createBaseOptions({
addresses: {
listen: [
'/ip4/0.0.0.0/tcp/0'
]
},
services: {
ping: pingService()
}
})
}),
createNode({
config: createBaseOptions({
addresses: {
listen: [
'/ip4/0.0.0.0/tcp/0'
]
},
services: {
ping: pingService()
}
Expand Down

0 comments on commit bd40d59

Please sign in to comment.