@@ -27,6 +27,7 @@ import (
27
27
"math/big"
28
28
"os"
29
29
"os/exec"
30
+ "runtime"
30
31
"testing"
31
32
"time"
32
33
@@ -42,6 +43,8 @@ import (
42
43
"google.golang.org/grpc"
43
44
)
44
45
46
+ const ppc64 = "ppc64le"
47
+
45
48
const keyfile = "sbft/testdata/key.pem"
46
49
const maindir = "github.com/hyperledger/fabric/orderer"
47
50
@@ -105,7 +108,7 @@ func TestMain(m *testing.M) {
105
108
}
106
109
107
110
func TestTwoReplicasBroadcastAndDeliverUsingTheSame (t * testing.T ) {
108
- t . Parallel ( )
111
+ parallelIfNotPpc64 ( t )
109
112
startingPort := 2000
110
113
skipInShortMode (t )
111
114
peers := InitPeers (2 , startingPort )
@@ -128,7 +131,7 @@ func TestTwoReplicasBroadcastAndDeliverUsingTheSame(t *testing.T) {
128
131
}
129
132
130
133
func TestTwoReplicasBroadcastAndDeliverUsingDifferent (t * testing.T ) {
131
- t . Parallel ( )
134
+ parallelIfNotPpc64 ( t )
132
135
logging .SetLevel (logging .DEBUG , "sbft" )
133
136
startingPort := 2500
134
137
skipInShortMode (t )
@@ -152,7 +155,7 @@ func TestTwoReplicasBroadcastAndDeliverUsingDifferent(t *testing.T) {
152
155
}
153
156
154
157
func TestTenReplicasBroadcastAndDeliverUsingDifferent (t * testing.T ) {
155
- t . Parallel ( )
158
+ parallelIfNotPpc64 ( t )
156
159
startingPort := 3000
157
160
skipInShortMode (t )
158
161
peers := InitPeers (10 , startingPort )
@@ -175,7 +178,7 @@ func TestTenReplicasBroadcastAndDeliverUsingDifferent(t *testing.T) {
175
178
}
176
179
177
180
func TestFourReplicasBombedWithBroadcasts (t * testing.T ) {
178
- t . Parallel ( )
181
+ parallelIfNotPpc64 ( t )
179
182
startingPort := 4000
180
183
skipInShortMode (t )
181
184
// Add for debug mode:
@@ -204,7 +207,7 @@ func TestFourReplicasBombedWithBroadcasts(t *testing.T) {
204
207
}
205
208
206
209
func TestTenReplicasBombedWithBroadcasts (t * testing.T ) {
207
- t . Parallel ( )
210
+ parallelIfNotPpc64 ( t )
208
211
startingPort := 5000
209
212
skipInShortMode (t )
210
213
broadcastCount := 15
@@ -231,7 +234,7 @@ func TestTenReplicasBombedWithBroadcasts(t *testing.T) {
231
234
}
232
235
233
236
func TestTenReplicasBombedWithBroadcastsIfLedgersConsistent (t * testing.T ) {
234
- t . Parallel ( )
237
+ parallelIfNotPpc64 ( t )
235
238
startingPort := 6000
236
239
skipInShortMode (t )
237
240
broadcastCount := 15
@@ -269,6 +272,12 @@ func TestTenReplicasBombedWithBroadcastsIfLedgersConsistent(t *testing.T) {
269
272
}
270
273
}
271
274
275
+ func parallelIfNotPpc64 (t * testing.T ) {
276
+ if runtime .GOARCH != ppc64 {
277
+ t .Parallel ()
278
+ }
279
+ }
280
+
272
281
func InitPeers (num uint64 , startingPort int ) []* Peer {
273
282
peers := make ([]* Peer , 0 , num )
274
283
certFiles := make ([]string , 0 , num )
@@ -291,6 +300,9 @@ func InitPeers(num uint64, startingPort int) []*Peer {
291
300
func StartPeers (peers []* Peer ) {
292
301
for _ , p := range peers {
293
302
p .start ()
303
+ if runtime .GOARCH == ppc64 {
304
+ time .Sleep (3 * time .Second )
305
+ }
294
306
}
295
307
}
296
308
0 commit comments