mirror of
https://github.com/fluencelabs/js-libp2p
synced 2025-04-25 10:32:14 +00:00
test: fix pubsub intermittent test (#741)
This commit is contained in:
parent
81e70df742
commit
28b79a76a8
@ -311,7 +311,11 @@ describe('Pubsub subsystem operates correctly', () => {
|
|||||||
expect(handlerSpy.args.map(([message]) => uint8ArrayToString(message.data))).to.include.members(['message1', 'message2'])
|
expect(handlerSpy.args.map(([message]) => uint8ArrayToString(message.data))).to.include.members(['message1', 'message2'])
|
||||||
|
|
||||||
// Disconnect the first connection (this acts as a delayed reconnect)
|
// Disconnect the first connection (this acts as a delayed reconnect)
|
||||||
|
const libp2pConnUpdateSpy = sinon.spy(libp2p.connectionManager.connections, 'set')
|
||||||
|
const remoteLibp2pConnUpdateSpy = sinon.spy(remoteLibp2p.connectionManager.connections, 'set')
|
||||||
|
|
||||||
await originalConnection.close()
|
await originalConnection.close()
|
||||||
|
await pWaitFor(() => libp2pConnUpdateSpy.callCount === 1 && remoteLibp2pConnUpdateSpy.callCount === 1)
|
||||||
|
|
||||||
// Verify messages go both ways after the disconnect
|
// Verify messages go both ways after the disconnect
|
||||||
handlerSpy.resetHistory()
|
handlerSpy.resetHistory()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user