Skip to content

Commit

Permalink
Fix in gossip_test.go
Browse files Browse the repository at this point in the history
Removed commented out test from gossip_test.go file.

Change-Id: I5e60ccd768974311d9f7b2652020edcf3432650d
Signed-off-by: Gennady Laventman <gennady@il.ibm.com>
  • Loading branch information
gennadylaventman committed Feb 8, 2017
1 parent 0db4b6c commit f7c19f8
Showing 1 changed file with 0 additions and 72 deletions.
72 changes: 0 additions & 72 deletions gossip/gossip/gossip_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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("<<<TestLeadershipMsgDissemination>>>")
// testWG.Done()
//}

func createDataMsg(seqnum uint64, data []byte, hash string, channel common.ChainID) *proto.GossipMessage {
return &proto.GossipMessage{
Channel: []byte(channel),
Expand Down

0 comments on commit f7c19f8

Please sign in to comment.