Skip to content

Commit ae48020

Browse files
committed
FAB-1688: Fix network test connection problem on ppc64
https://jira.hyperledger.org/browse/FAB-1688 Change-Id: I1d025e9d9462002a97d1dc8b096fbfc0efca4bc7 Signed-off-by: Gabor Hosszu <[email protected]>
1 parent 809759b commit ae48020

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

orderer/network_test.go

+18-6
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import (
2727
"math/big"
2828
"os"
2929
"os/exec"
30+
"runtime"
3031
"testing"
3132
"time"
3233

@@ -42,6 +43,8 @@ import (
4243
"google.golang.org/grpc"
4344
)
4445

46+
const ppc64 = "ppc64le"
47+
4548
const keyfile = "sbft/testdata/key.pem"
4649
const maindir = "github.com/hyperledger/fabric/orderer"
4750

@@ -105,7 +108,7 @@ func TestMain(m *testing.M) {
105108
}
106109

107110
func TestTwoReplicasBroadcastAndDeliverUsingTheSame(t *testing.T) {
108-
t.Parallel()
111+
parallelIfNotPpc64(t)
109112
startingPort := 2000
110113
skipInShortMode(t)
111114
peers := InitPeers(2, startingPort)
@@ -128,7 +131,7 @@ func TestTwoReplicasBroadcastAndDeliverUsingTheSame(t *testing.T) {
128131
}
129132

130133
func TestTwoReplicasBroadcastAndDeliverUsingDifferent(t *testing.T) {
131-
t.Parallel()
134+
parallelIfNotPpc64(t)
132135
logging.SetLevel(logging.DEBUG, "sbft")
133136
startingPort := 2500
134137
skipInShortMode(t)
@@ -152,7 +155,7 @@ func TestTwoReplicasBroadcastAndDeliverUsingDifferent(t *testing.T) {
152155
}
153156

154157
func TestTenReplicasBroadcastAndDeliverUsingDifferent(t *testing.T) {
155-
t.Parallel()
158+
parallelIfNotPpc64(t)
156159
startingPort := 3000
157160
skipInShortMode(t)
158161
peers := InitPeers(10, startingPort)
@@ -175,7 +178,7 @@ func TestTenReplicasBroadcastAndDeliverUsingDifferent(t *testing.T) {
175178
}
176179

177180
func TestFourReplicasBombedWithBroadcasts(t *testing.T) {
178-
t.Parallel()
181+
parallelIfNotPpc64(t)
179182
startingPort := 4000
180183
skipInShortMode(t)
181184
// Add for debug mode:
@@ -204,7 +207,7 @@ func TestFourReplicasBombedWithBroadcasts(t *testing.T) {
204207
}
205208

206209
func TestTenReplicasBombedWithBroadcasts(t *testing.T) {
207-
t.Parallel()
210+
parallelIfNotPpc64(t)
208211
startingPort := 5000
209212
skipInShortMode(t)
210213
broadcastCount := 15
@@ -231,7 +234,7 @@ func TestTenReplicasBombedWithBroadcasts(t *testing.T) {
231234
}
232235

233236
func TestTenReplicasBombedWithBroadcastsIfLedgersConsistent(t *testing.T) {
234-
t.Parallel()
237+
parallelIfNotPpc64(t)
235238
startingPort := 6000
236239
skipInShortMode(t)
237240
broadcastCount := 15
@@ -269,6 +272,12 @@ func TestTenReplicasBombedWithBroadcastsIfLedgersConsistent(t *testing.T) {
269272
}
270273
}
271274

275+
func parallelIfNotPpc64(t *testing.T) {
276+
if runtime.GOARCH != ppc64 {
277+
t.Parallel()
278+
}
279+
}
280+
272281
func InitPeers(num uint64, startingPort int) []*Peer {
273282
peers := make([]*Peer, 0, num)
274283
certFiles := make([]string, 0, num)
@@ -291,6 +300,9 @@ func InitPeers(num uint64, startingPort int) []*Peer {
291300
func StartPeers(peers []*Peer) {
292301
for _, p := range peers {
293302
p.start()
303+
if runtime.GOARCH == ppc64 {
304+
time.Sleep(3 * time.Second)
305+
}
294306
}
295307
}
296308

0 commit comments

Comments
 (0)