chore: adding test for starting node twice

This commit is contained in:
Gabriel mermelstein 2025-07-24 16:08:43 +02:00
parent 6feba5b0df
commit 2ed0a5f171
No known key found for this signature in database
GPG Key ID: 82B8134785FEAE0D

View File

@ -5,6 +5,7 @@ import (
"time"
"github.com/stretchr/testify/require"
"github.com/waku-org/waku-go-bindings/waku/common"
)
func TestBasicWakuNodes(t *testing.T) {
@ -68,3 +69,29 @@ func TestNodeRestart(t *testing.T) {
Debug("TestNodeRestart completed successfully")
}
func TestDoubleStart(t *testing.T) {
tcpPort, udpPort, err := GetFreePortIfNeeded(0, 0)
require.NoError(t, err)
config := common.WakuConfig{
Relay: true,
Store: true,
LogLevel: "DEBUG",
Discv5Discovery: true,
ClusterID: 16,
Shards: []uint16{64},
Discv5UdpPort: udpPort,
TcpPort: tcpPort,
}
node, err := NewWakuNode(&config, "node")
require.NoError(t, err)
defer node.StopAndDestroy()
// start node
require.NoError(t, node.Start())
// now attempt to start again
require.NoError(t, node.Start())
}