diff --git a/gossip/comm/comm_test.go b/gossip/comm/comm_test.go index 8f33b845f4c..96cdc0e9776 100644 --- a/gossip/comm/comm_test.go +++ b/gossip/comm/comm_test.go @@ -70,6 +70,7 @@ func newCommInstance(port int, sec SecurityProvider) (Comm, error) { } func TestHandshake(t *testing.T) { + t.Parallel() comm1, _ := newCommInstance(9611, naiveSec) defer comm1.Stop() @@ -246,8 +247,8 @@ func TestBlackListPKIid(t *testing.T) { func TestParallelSend(t *testing.T) { t.Parallel() - comm1, _ := newCommInstance(5611, naiveSec) - comm2, _ := newCommInstance(5612, naiveSec) + comm1, _ := newCommInstance(5411, naiveSec) + comm2, _ := newCommInstance(5412, naiveSec) defer comm1.Stop() defer comm2.Stop() @@ -260,7 +261,7 @@ func TestParallelSend(t *testing.T) { emptyMsg := createGossipMsg() go func() { defer wg.Done() - comm1.Send(emptyMsg, remotePeer(5612)) + comm1.Send(emptyMsg, remotePeer(5412)) }() } wg.Wait() diff --git a/gossip/comm/crypto_test.go b/gossip/comm/crypto_test.go index d5b96603d7a..ecf31ad9f97 100644 --- a/gossip/comm/crypto_test.go +++ b/gossip/comm/crypto_test.go @@ -78,7 +78,7 @@ func TestCertificateGeneration(t *testing.T) { return } s := grpc.NewServer(grpc.Creds(creds)) - ll, err = net.Listen("tcp", fmt.Sprintf("%s:%d", "", 5611)) + ll, err = net.Listen("tcp", fmt.Sprintf("%s:%d", "", 5511)) assert.NoError(t, err, "%v", err) if err != nil { return @@ -98,7 +98,7 @@ func TestCertificateGeneration(t *testing.T) { if err != nil { return } - conn, err := grpc.Dial("localhost:5611", grpc.WithTransportCredentials(&authCreds{tlsCreds: ta}), grpc.WithBlock(), grpc.WithTimeout(time.Second)) + conn, err := grpc.Dial("localhost:5511", grpc.WithTransportCredentials(&authCreds{tlsCreds: ta}), grpc.WithBlock(), grpc.WithTimeout(time.Second)) assert.NoError(t, err, "%v", err) if err != nil { return diff --git a/gossip/discovery/discovery_test.go b/gossip/discovery/discovery_test.go index 428f786652c..ff96bae2f11 100644 --- a/gossip/discovery/discovery_test.go +++ b/gossip/discovery/discovery_test.go @@ -259,6 +259,7 @@ func bootPeer(port int) string { } func TestUpdate(t *testing.T) { + t.Parallel() nodeNum := 5 bootPeers := []string{bootPeer(6611), bootPeer(6612)} instances := []*gossipInstance{} @@ -308,6 +309,7 @@ func TestUpdate(t *testing.T) { } func TestInitiateSync(t *testing.T) { + t.Parallel() nodeNum := 10 bootPeers := []string{bootPeer(3611), bootPeer(3612)} instances := []*gossipInstance{} @@ -334,6 +336,7 @@ func TestInitiateSync(t *testing.T) { } func TestExpiration(t *testing.T) { + t.Parallel() nodeNum := 5 bootPeers := []string{bootPeer(2611), bootPeer(2612)} instances := []*gossipInstance{} @@ -373,19 +376,20 @@ func TestExpiration(t *testing.T) { } func TestGetFullMembership(t *testing.T) { + t.Parallel() nodeNum := 15 - bootPeers := []string{bootPeer(5611), bootPeer(5612)} + bootPeers := []string{bootPeer(5511), bootPeer(5512)} instances := []*gossipInstance{} - inst := createDiscoveryInstance(5611, "d1", bootPeers) + inst := createDiscoveryInstance(5511, "d1", bootPeers) instances = append(instances, inst) - inst = createDiscoveryInstance(5612, "d2", bootPeers) + inst = createDiscoveryInstance(5512, "d2", bootPeers) instances = append(instances, inst) for i := 3; i <= nodeNum; i++ { id := fmt.Sprintf("d%d", i) - inst = createDiscoveryInstance(5610+i, id, bootPeers) + inst = createDiscoveryInstance(5510+i, id, bootPeers) instances = append(instances, inst) } @@ -394,6 +398,7 @@ func TestGetFullMembership(t *testing.T) { } func TestGossipDiscoveryStopping(t *testing.T) { + t.Parallel() inst := createDiscoveryInstance(9611, "d1", []string{bootPeer(9611)}) time.Sleep(time.Second) waitUntilOrFailBlocking(t, inst.Stop) @@ -401,6 +406,7 @@ func TestGossipDiscoveryStopping(t *testing.T) { } func TestConvergence(t *testing.T) { + t.Parallel() // scenario: // {boot peer: [peer list]} // {d1: d2, d3, d4}