extend star topology test to assert that no peer is left with a single connection

This commit is contained in:
vyzo 2019-11-23 18:16:56 +02:00
parent 2e7cdebf34
commit f280c5f705
1 changed files with 7 additions and 0 deletions

View File

@ -964,6 +964,13 @@ func TestGossipsubStarTopology(t *testing.T) {
// wait a bit for the mesh to build
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
for i := 0; i < 20; i++ {
msg := []byte(fmt.Sprintf("message %d", i))