Skip to content

Commit

Permalink
Skip SBFT tests in short test mode
Browse files Browse the repository at this point in the history
Change-Id: I40e5ddd751bf71ae30d2716ac1d4ee5f82add919
Signed-off-by: Gabor Hosszu <gabor@digitalasset.com>
  • Loading branch information
gaborh-da committed Dec 20, 2016
1 parent 6e9073c commit e78490e
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
11 changes: 11 additions & 0 deletions orderer/sbft/main/network_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ type receiver struct {
signals chan bool
}

func skipInShortMode(t *testing.T) {
if testing.Short() {
t.Skip("Skipping test in short mode.")
}
}

func build() {
buildcmd := exec.Command("go", "build", maindir)
buildcmd.Stdout = os.Stdout
Expand All @@ -82,6 +88,7 @@ func TestMain(m *testing.M) {
}

func TestTwoReplicasBroadcastAndDeliverUsingTheSame(t *testing.T) {
skipInShortMode(t)
peers := InitPeers(2)
StartPeers(peers)
r, err := Receive(peers[1])
Expand All @@ -100,6 +107,7 @@ func TestTwoReplicasBroadcastAndDeliverUsingTheSame(t *testing.T) {
}

func TestTenReplicasBroadcastAndDeliverUsingDifferent(t *testing.T) {
skipInShortMode(t)
peers := InitPeers(10)
StartPeers(peers)
r, err := Receive(peers[9])
Expand All @@ -118,6 +126,7 @@ func TestTenReplicasBroadcastAndDeliverUsingDifferent(t *testing.T) {
}

func TestFourReplicasBombedWithBroadcasts(t *testing.T) {
skipInShortMode(t)
// Add for debug mode:
// logging.SetLevel(logging.DEBUG, "sbft")
broadcastCount := 15
Expand All @@ -142,6 +151,7 @@ func TestFourReplicasBombedWithBroadcasts(t *testing.T) {
}

func TestTenReplicasBombedWithBroadcasts(t *testing.T) {
skipInShortMode(t)
broadcastCount := 15
peers := InitPeers(10)
StartPeers(peers)
Expand All @@ -164,6 +174,7 @@ func TestTenReplicasBombedWithBroadcasts(t *testing.T) {
}

func TestTenReplicasBombedWithBroadcastsIfLedgersConsistent(t *testing.T) {
skipInShortMode(t)
broadcastCount := 15
peers := InitPeers(10)
StartPeers(peers)
Expand Down
1 change: 1 addition & 0 deletions orderer/sbft/main/sbft_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ var NEEDED_UPDATES = 2
var NEEDED_SENT = 1

func TestSbftPeer(t *testing.T) {
skipInShortMode(t)
tempDir, err := ioutil.TempDir("", "sbft_test")
if err != nil {
panic("Failed to create a temporary directory")
Expand Down
28 changes: 28 additions & 0 deletions orderer/sbft/simplebft/simplebft_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ func init() {
//logging.SetLevel(logging.DEBUG, "sbft")
}

func skipInShortMode(t *testing.T) {
if testing.Short() {
t.Skip("Skipping test in short mode.")
}
}

func connectAll(sys *testSystem) {
// map iteration is non-deterministic, so use linear iteration instead
max := uint64(0)
Expand Down Expand Up @@ -62,6 +68,7 @@ func connectAll(sys *testSystem) {
}

func TestSBFT(t *testing.T) {
skipInShortMode(t)
N := uint64(4)
sys := newTestSystem(N)
var repls []*SBFT
Expand Down Expand Up @@ -98,6 +105,7 @@ func TestSBFT(t *testing.T) {
}

func TestSBFTDelayed(t *testing.T) {
skipInShortMode(t)
N := uint64(4)
sys := newTestSystem(N)
var repls []*SBFT
Expand Down Expand Up @@ -139,6 +147,7 @@ func TestSBFTDelayed(t *testing.T) {
}

func TestN1(t *testing.T) {
skipInShortMode(t)
N := uint64(1)
sys := newTestSystem(N)
var repls []*SBFT
Expand Down Expand Up @@ -167,6 +176,7 @@ func TestN1(t *testing.T) {
}

func TestMonotonicViews(t *testing.T) {
skipInShortMode(t)
N := uint64(4)
sys := newTestSystem(N)
var repls []*SBFT
Expand Down Expand Up @@ -202,6 +212,7 @@ func TestMonotonicViews(t *testing.T) {
}

func TestByzPrimary(t *testing.T) {
skipInShortMode(t)
N := uint64(4)
sys := newTestSystem(N)
var repls []*SBFT
Expand Down Expand Up @@ -256,6 +267,7 @@ func TestByzPrimary(t *testing.T) {
}

func TestViewChange(t *testing.T) {
skipInShortMode(t)
N := uint64(4)
sys := newTestSystem(N)
var repls []*SBFT
Expand Down Expand Up @@ -295,6 +307,7 @@ func TestViewChange(t *testing.T) {
}

func TestMsgReordering(t *testing.T) {
skipInShortMode(t)
N := uint64(4)
sys := newTestSystem(N)
var repls []*SBFT
Expand Down Expand Up @@ -347,6 +360,7 @@ func TestMsgReordering(t *testing.T) {
}

func TestBacklogReordering(t *testing.T) {
skipInShortMode(t)
N := uint64(4)
sys := newTestSystem(N)
var repls []*SBFT
Expand Down Expand Up @@ -399,6 +413,7 @@ func TestBacklogReordering(t *testing.T) {
}

func TestViewChangeWithRetransmission(t *testing.T) {
skipInShortMode(t)
N := uint64(4)
sys := newTestSystem(N)
var repls []*SBFT
Expand Down Expand Up @@ -438,6 +453,7 @@ func TestViewChangeWithRetransmission(t *testing.T) {
}

func TestViewChangeXset(t *testing.T) {
skipInShortMode(t)
N := uint64(4)
sys := newTestSystem(N)
var repls []*SBFT
Expand Down Expand Up @@ -514,6 +530,7 @@ func TestViewChangeXset(t *testing.T) {
}

func TestRestart(t *testing.T) {
skipInShortMode(t)
N := uint64(4)
sys := newTestSystem(N)
var repls []*SBFT
Expand Down Expand Up @@ -567,6 +584,7 @@ func TestRestart(t *testing.T) {
}

func TestAbdicatingPrimary(t *testing.T) {
skipInShortMode(t)
N := uint64(4)
sys := newTestSystem(N)
var repls []*SBFT
Expand Down Expand Up @@ -625,6 +643,7 @@ func TestAbdicatingPrimary(t *testing.T) {
}

func TestRestartAfterPrepare(t *testing.T) {
skipInShortMode(t)
N := uint64(4)
sys := newTestSystem(N)
var repls []*SBFT
Expand Down Expand Up @@ -694,6 +713,7 @@ func TestRestartAfterPrepare(t *testing.T) {
}

func TestRestartAfterCommit(t *testing.T) {
skipInShortMode(t)
N := uint64(4)
sys := newTestSystem(N)
var repls []*SBFT
Expand Down Expand Up @@ -763,6 +783,7 @@ func TestRestartAfterCommit(t *testing.T) {
}

func TestRestartAfterCheckpoint(t *testing.T) {
skipInShortMode(t)
N := uint64(4)
sys := newTestSystem(N)
var repls []*SBFT
Expand Down Expand Up @@ -832,6 +853,7 @@ func TestRestartAfterCheckpoint(t *testing.T) {
}

func TestErroneousViewChange(t *testing.T) {
skipInShortMode(t)
N := uint64(4)
sys := newTestSystem(N)
var repls []*SBFT
Expand Down Expand Up @@ -921,6 +943,7 @@ func TestErroneousViewChange(t *testing.T) {
}

func TestRestartMissedViewChange(t *testing.T) {
skipInShortMode(t)
N := uint64(4)
sys := newTestSystem(N)
var repls []*SBFT
Expand Down Expand Up @@ -993,6 +1016,7 @@ func TestRestartMissedViewChange(t *testing.T) {
}

func TestFullBacklog(t *testing.T) {
skipInShortMode(t)
N := uint64(4)
sys := newTestSystem(N)
var repls []*SBFT
Expand Down Expand Up @@ -1034,6 +1058,7 @@ func TestFullBacklog(t *testing.T) {
}

func TestHelloMsg(t *testing.T) {
skipInShortMode(t)
N := uint64(4)
sys := newTestSystemWOTimers(N)
var repls []*SBFT
Expand Down Expand Up @@ -1100,6 +1125,7 @@ func TestHelloMsg(t *testing.T) {
}

func TestViewChangeTimer(t *testing.T) {
skipInShortMode(t)
N := uint64(4)
sys := newTestSystem(N)
var repls []*SBFT
Expand Down Expand Up @@ -1183,6 +1209,7 @@ func TestViewChangeTimer(t *testing.T) {
}

func TestResendViewChange(t *testing.T) {
skipInShortMode(t)
N := uint64(4)
sys := newTestSystem(N)
var repls []*SBFT
Expand Down Expand Up @@ -1242,6 +1269,7 @@ func TestResendViewChange(t *testing.T) {
}

func TestTenReplicasBombedWithRequests(t *testing.T) {
skipInShortMode(t)
N := uint64(10)
requestNumber := 11
sys := newTestSystem(N)
Expand Down

0 comments on commit e78490e

Please sign in to comment.