mirror of
https://github.com/logos-messaging/logos-messaging-go-bindings.git
synced 2026-01-02 05:53:07 +00:00
chore: fix bindings tests (#75)
This commit is contained in:
parent
7240a5e3ef
commit
aba0b96cfb
@ -5,6 +5,7 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/cenkalti/backoff/v3"
|
||||
"github.com/stretchr/testify/require"
|
||||
"github.com/waku-org/go-waku/waku/v2/protocol/pb"
|
||||
|
||||
@ -823,6 +824,7 @@ func TestCheckStoredMSGsEphemeralFalse(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestCheckLegacyStore(t *testing.T) {
|
||||
t.Skip("Skipping test as legacy store is about to be removed and no longer maintained")
|
||||
Debug("Starting test ")
|
||||
|
||||
node1Config := DefaultWakuConfig
|
||||
@ -1177,6 +1179,31 @@ 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")
|
||||
|
||||
queryTimestamp := proto.Int64(time.Now().UnixNano())
|
||||
var msg = node1.CreateMessage()
|
||||
Debug("Node1 is publishing two identical messages")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user