Skip to content

Commit e78490e

Browse files
committed
Skip SBFT tests in short test mode
Change-Id: I40e5ddd751bf71ae30d2716ac1d4ee5f82add919 Signed-off-by: Gabor Hosszu <[email protected]>
1 parent 6e9073c commit e78490e

File tree

3 files changed

+40
-0
lines changed

3 files changed

+40
-0
lines changed

orderer/sbft/main/network_test.go

+11
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@ type receiver struct {
6060
signals chan bool
6161
}
6262

63+
func skipInShortMode(t *testing.T) {
64+
if testing.Short() {
65+
t.Skip("Skipping test in short mode.")
66+
}
67+
}
68+
6369
func build() {
6470
buildcmd := exec.Command("go", "build", maindir)
6571
buildcmd.Stdout = os.Stdout
@@ -82,6 +88,7 @@ func TestMain(m *testing.M) {
8288
}
8389

8490
func TestTwoReplicasBroadcastAndDeliverUsingTheSame(t *testing.T) {
91+
skipInShortMode(t)
8592
peers := InitPeers(2)
8693
StartPeers(peers)
8794
r, err := Receive(peers[1])
@@ -100,6 +107,7 @@ func TestTwoReplicasBroadcastAndDeliverUsingTheSame(t *testing.T) {
100107
}
101108

102109
func TestTenReplicasBroadcastAndDeliverUsingDifferent(t *testing.T) {
110+
skipInShortMode(t)
103111
peers := InitPeers(10)
104112
StartPeers(peers)
105113
r, err := Receive(peers[9])
@@ -118,6 +126,7 @@ func TestTenReplicasBroadcastAndDeliverUsingDifferent(t *testing.T) {
118126
}
119127

120128
func TestFourReplicasBombedWithBroadcasts(t *testing.T) {
129+
skipInShortMode(t)
121130
// Add for debug mode:
122131
// logging.SetLevel(logging.DEBUG, "sbft")
123132
broadcastCount := 15
@@ -142,6 +151,7 @@ func TestFourReplicasBombedWithBroadcasts(t *testing.T) {
142151
}
143152

144153
func TestTenReplicasBombedWithBroadcasts(t *testing.T) {
154+
skipInShortMode(t)
145155
broadcastCount := 15
146156
peers := InitPeers(10)
147157
StartPeers(peers)
@@ -164,6 +174,7 @@ func TestTenReplicasBombedWithBroadcasts(t *testing.T) {
164174
}
165175

166176
func TestTenReplicasBombedWithBroadcastsIfLedgersConsistent(t *testing.T) {
177+
skipInShortMode(t)
167178
broadcastCount := 15
168179
peers := InitPeers(10)
169180
StartPeers(peers)

orderer/sbft/main/sbft_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ var NEEDED_UPDATES = 2
4141
var NEEDED_SENT = 1
4242

4343
func TestSbftPeer(t *testing.T) {
44+
skipInShortMode(t)
4445
tempDir, err := ioutil.TempDir("", "sbft_test")
4546
if err != nil {
4647
panic("Failed to create a temporary directory")

orderer/sbft/simplebft/simplebft_test.go

+28
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ func init() {
3333
//logging.SetLevel(logging.DEBUG, "sbft")
3434
}
3535

36+
func skipInShortMode(t *testing.T) {
37+
if testing.Short() {
38+
t.Skip("Skipping test in short mode.")
39+
}
40+
}
41+
3642
func connectAll(sys *testSystem) {
3743
// map iteration is non-deterministic, so use linear iteration instead
3844
max := uint64(0)
@@ -62,6 +68,7 @@ func connectAll(sys *testSystem) {
6268
}
6369

6470
func TestSBFT(t *testing.T) {
71+
skipInShortMode(t)
6572
N := uint64(4)
6673
sys := newTestSystem(N)
6774
var repls []*SBFT
@@ -98,6 +105,7 @@ func TestSBFT(t *testing.T) {
98105
}
99106

100107
func TestSBFTDelayed(t *testing.T) {
108+
skipInShortMode(t)
101109
N := uint64(4)
102110
sys := newTestSystem(N)
103111
var repls []*SBFT
@@ -139,6 +147,7 @@ func TestSBFTDelayed(t *testing.T) {
139147
}
140148

141149
func TestN1(t *testing.T) {
150+
skipInShortMode(t)
142151
N := uint64(1)
143152
sys := newTestSystem(N)
144153
var repls []*SBFT
@@ -167,6 +176,7 @@ func TestN1(t *testing.T) {
167176
}
168177

169178
func TestMonotonicViews(t *testing.T) {
179+
skipInShortMode(t)
170180
N := uint64(4)
171181
sys := newTestSystem(N)
172182
var repls []*SBFT
@@ -202,6 +212,7 @@ func TestMonotonicViews(t *testing.T) {
202212
}
203213

204214
func TestByzPrimary(t *testing.T) {
215+
skipInShortMode(t)
205216
N := uint64(4)
206217
sys := newTestSystem(N)
207218
var repls []*SBFT
@@ -256,6 +267,7 @@ func TestByzPrimary(t *testing.T) {
256267
}
257268

258269
func TestViewChange(t *testing.T) {
270+
skipInShortMode(t)
259271
N := uint64(4)
260272
sys := newTestSystem(N)
261273
var repls []*SBFT
@@ -295,6 +307,7 @@ func TestViewChange(t *testing.T) {
295307
}
296308

297309
func TestMsgReordering(t *testing.T) {
310+
skipInShortMode(t)
298311
N := uint64(4)
299312
sys := newTestSystem(N)
300313
var repls []*SBFT
@@ -347,6 +360,7 @@ func TestMsgReordering(t *testing.T) {
347360
}
348361

349362
func TestBacklogReordering(t *testing.T) {
363+
skipInShortMode(t)
350364
N := uint64(4)
351365
sys := newTestSystem(N)
352366
var repls []*SBFT
@@ -399,6 +413,7 @@ func TestBacklogReordering(t *testing.T) {
399413
}
400414

401415
func TestViewChangeWithRetransmission(t *testing.T) {
416+
skipInShortMode(t)
402417
N := uint64(4)
403418
sys := newTestSystem(N)
404419
var repls []*SBFT
@@ -438,6 +453,7 @@ func TestViewChangeWithRetransmission(t *testing.T) {
438453
}
439454

440455
func TestViewChangeXset(t *testing.T) {
456+
skipInShortMode(t)
441457
N := uint64(4)
442458
sys := newTestSystem(N)
443459
var repls []*SBFT
@@ -514,6 +530,7 @@ func TestViewChangeXset(t *testing.T) {
514530
}
515531

516532
func TestRestart(t *testing.T) {
533+
skipInShortMode(t)
517534
N := uint64(4)
518535
sys := newTestSystem(N)
519536
var repls []*SBFT
@@ -567,6 +584,7 @@ func TestRestart(t *testing.T) {
567584
}
568585

569586
func TestAbdicatingPrimary(t *testing.T) {
587+
skipInShortMode(t)
570588
N := uint64(4)
571589
sys := newTestSystem(N)
572590
var repls []*SBFT
@@ -625,6 +643,7 @@ func TestAbdicatingPrimary(t *testing.T) {
625643
}
626644

627645
func TestRestartAfterPrepare(t *testing.T) {
646+
skipInShortMode(t)
628647
N := uint64(4)
629648
sys := newTestSystem(N)
630649
var repls []*SBFT
@@ -694,6 +713,7 @@ func TestRestartAfterPrepare(t *testing.T) {
694713
}
695714

696715
func TestRestartAfterCommit(t *testing.T) {
716+
skipInShortMode(t)
697717
N := uint64(4)
698718
sys := newTestSystem(N)
699719
var repls []*SBFT
@@ -763,6 +783,7 @@ func TestRestartAfterCommit(t *testing.T) {
763783
}
764784

765785
func TestRestartAfterCheckpoint(t *testing.T) {
786+
skipInShortMode(t)
766787
N := uint64(4)
767788
sys := newTestSystem(N)
768789
var repls []*SBFT
@@ -832,6 +853,7 @@ func TestRestartAfterCheckpoint(t *testing.T) {
832853
}
833854

834855
func TestErroneousViewChange(t *testing.T) {
856+
skipInShortMode(t)
835857
N := uint64(4)
836858
sys := newTestSystem(N)
837859
var repls []*SBFT
@@ -921,6 +943,7 @@ func TestErroneousViewChange(t *testing.T) {
921943
}
922944

923945
func TestRestartMissedViewChange(t *testing.T) {
946+
skipInShortMode(t)
924947
N := uint64(4)
925948
sys := newTestSystem(N)
926949
var repls []*SBFT
@@ -993,6 +1016,7 @@ func TestRestartMissedViewChange(t *testing.T) {
9931016
}
9941017

9951018
func TestFullBacklog(t *testing.T) {
1019+
skipInShortMode(t)
9961020
N := uint64(4)
9971021
sys := newTestSystem(N)
9981022
var repls []*SBFT
@@ -1034,6 +1058,7 @@ func TestFullBacklog(t *testing.T) {
10341058
}
10351059

10361060
func TestHelloMsg(t *testing.T) {
1061+
skipInShortMode(t)
10371062
N := uint64(4)
10381063
sys := newTestSystemWOTimers(N)
10391064
var repls []*SBFT
@@ -1100,6 +1125,7 @@ func TestHelloMsg(t *testing.T) {
11001125
}
11011126

11021127
func TestViewChangeTimer(t *testing.T) {
1128+
skipInShortMode(t)
11031129
N := uint64(4)
11041130
sys := newTestSystem(N)
11051131
var repls []*SBFT
@@ -1183,6 +1209,7 @@ func TestViewChangeTimer(t *testing.T) {
11831209
}
11841210

11851211
func TestResendViewChange(t *testing.T) {
1212+
skipInShortMode(t)
11861213
N := uint64(4)
11871214
sys := newTestSystem(N)
11881215
var repls []*SBFT
@@ -1242,6 +1269,7 @@ func TestResendViewChange(t *testing.T) {
12421269
}
12431270

12441271
func TestTenReplicasBombedWithRequests(t *testing.T) {
1272+
skipInShortMode(t)
12451273
N := uint64(10)
12461274
requestNumber := 11
12471275
sys := newTestSystem(N)

0 commit comments

Comments
 (0)