mirror of
https://github.com/logos-messaging/logos-messaging-go-bindings.git
synced 2026-01-02 14:03:10 +00:00
chore: add test for double stop
This commit is contained in:
parent
2ed0a5f171
commit
90005c72dd
@ -95,3 +95,34 @@ func TestDoubleStart(t *testing.T) {
|
||||
require.NoError(t, node.Start())
|
||||
|
||||
}
|
||||
|
||||
func TestDoubleStop(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())
|
||||
|
||||
// stop node
|
||||
require.NoError(t, node.Stop())
|
||||
|
||||
// now attempt to stop it again
|
||||
require.NoError(t, node.Stop())
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user