mirror of
https://github.com/logos-messaging/logos-messaging-go-bindings.git
synced 2026-01-04 06:53:11 +00:00
using waitForAutoconnection in duplicate message test
This commit is contained in:
parent
6cd720b915
commit
6e852f16b9
@ -5,7 +5,6 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/cenkalti/backoff/v3"
|
||||
"github.com/stretchr/testify/require"
|
||||
"github.com/waku-org/go-waku/waku/v2/protocol/pb"
|
||||
|
||||
@ -1179,30 +1178,8 @@ func TestStoredDuplicateMessage(t *testing.T) {
|
||||
err = node2.ConnectPeer(node1)
|
||||
require.NoError(t, err, "Failed to connect Node2 to Node1")
|
||||
|
||||
Debug("Waiting for peer connections to stabilize")
|
||||
options := func(b *backoff.ExponentialBackOff) {
|
||||
b.MaxElapsedTime = 10 * time.Second
|
||||
}
|
||||
|
||||
require.NoError(t, RetryWithBackOff(func() error {
|
||||
numPeersNode1, err := node1.GetNumConnectedRelayPeers(DefaultPubsubTopic)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if numPeersNode1 == 0 {
|
||||
return fmt.Errorf("node1 has 0 relay peers, expected at least 1")
|
||||
}
|
||||
|
||||
numPeersNode2, err := node2.GetNumConnectedRelayPeers(DefaultPubsubTopic)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if numPeersNode2 == 0 {
|
||||
return fmt.Errorf("node2 has 0 relay peers, expected at least 1")
|
||||
}
|
||||
|
||||
return nil
|
||||
}, options), "Peers did not stabilize in time")
|
||||
err = WaitForAutoConnection([]*WakuNode{node1, node2})
|
||||
require.NoError(t, err, "Nodes did not connect within timeout")
|
||||
|
||||
queryTimestamp := proto.Int64(time.Now().UnixNano())
|
||||
var msg = node1.CreateMessage()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user