diff --git a/gossip/gossip/gossip_test.go b/gossip/gossip/gossip_test.go index 00745b8d903..ed954307ea1 100644 --- a/gossip/gossip/gossip_test.go +++ b/gossip/gossip/gossip_test.go @@ -819,78 +819,6 @@ func TestEndedGoroutines(t *testing.T) { ensureGoroutineExit(t) } -//func TestLeadershipMsgDissemination(t *testing.T) { -// t.Parallel() -// portPrefix := 3610 -// t1 := time.Now() -// // Scenario: 20 nodes and a bootstrap node. -// // The bootstrap node sends 10 leadership messages and we count -// // that each node got 10 messages after a few seconds -// -// stopped := int32(0) -// go waitForTestCompletion(&stopped, t) -// -// n := 10 -// msgsCount2Send := 10 -// boot := newGossipInstance(portPrefix, 0, 100) -// boot.JoinChan(&joinChanMsg{}, common.ChainID("A")) -// boot.UpdateChannelMetadata([]byte{}, common.ChainID("A")) -// -// peers := make([]Gossip, n) -// receivedMessages := make([]int, n) -// wg := sync.WaitGroup{} -// wg.Add(n) -// for i := 1; i <= n; i++ { -// pI := newGossipInstance(portPrefix, i, 100, 0) -// peers[i-1] = pI -// pI.JoinChan(&joinChanMsg{}, common.ChainID("A")) -// pI.UpdateChannelMetadata([]byte{}, common.ChainID("A")) -// acceptChan, _ := pI.Accept(acceptLeadershp, false) -// go func(index int, ch <-chan *proto.GossipMessage) { -// defer wg.Done() -// for j := 0; j < msgsCount2Send; j++ { -// <-ch -// receivedMessages[index]++ -// } -// }(i-1, acceptChan) -// } -// -// membershipTime := time.Now() -// waitUntilOrFail(t, checkPeersMembership(peers, n)) -// t.Log("Membership establishment took", time.Since(membershipTime)) -// -// seqNum := 0 -// incTime := uint64(time.Now().UnixNano()) -// -// for i := 1; i <= msgsCount2Send; i++ { -// seqNum++ -// leadershipMsg := createLeadershipMsg(true, common.ChainID("A"), incTime, uint64(seqNum), boot.(*gossipServiceImpl).conf.SelfEndpoint, boot.(*gossipServiceImpl).comm.GetPKIid()) -// boot.Gossip(leadershipMsg) -// time.Sleep(time.Duration(500) * time.Millisecond) -// } -// -// t2 := time.Now() -// waitUntilOrFailBlocking(t, wg.Wait) -// t.Log("Leadership message dissemination took", time.Since(t2)) -// -// for i := 0; i < n; i++ { -// assert.Equal(t, msgsCount2Send, receivedMessages[i]) -// } -// t.Log("Stopping peers") -// -// stop := func() { -// stopPeers(append(peers, boot)) -// } -// -// stopTime := time.Now() -// waitUntilOrFailBlocking(t, stop) -// t.Log("Stop took", time.Since(stopTime)) -// t.Log("Took", time.Since(t1)) -// atomic.StoreInt32(&stopped, int32(1)) -// fmt.Println("<<>>") -// testWG.Done() -//} - func createDataMsg(seqnum uint64, data []byte, hash string, channel common.ChainID) *proto.GossipMessage { return &proto.GossipMessage{ Channel: []byte(channel),