mirror of
https://github.com/logos-messaging/go-libp2p-pubsub.git
synced 2026-01-04 05:43:06 +00:00
extend star topology test to assert that no peer is left with a single connection
This commit is contained in:
parent
2e7cdebf34
commit
f280c5f705
@ -964,6 +964,13 @@ func TestGossipsubStarTopology(t *testing.T) {
|
|||||||
// wait a bit for the mesh to build
|
// wait a bit for the mesh to build
|
||||||
time.Sleep(10 * time.Second)
|
time.Sleep(10 * time.Second)
|
||||||
|
|
||||||
|
// check that all peers have > 1 connection
|
||||||
|
for _, h := range hosts {
|
||||||
|
if len(h.Network().Conns()) == 1 {
|
||||||
|
t.Error("peer has ony a single connection")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// send a message from each peer and assert it was propagated
|
// send a message from each peer and assert it was propagated
|
||||||
for i := 0; i < 20; i++ {
|
for i := 0; i < 20; i++ {
|
||||||
msg := []byte(fmt.Sprintf("message %d", i))
|
msg := []byte(fmt.Sprintf("message %d", i))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user