Skip to content

Commit

Permalink
Merge pull request etcd-io#6801 from xiang90/fix_snap_test
Browse files Browse the repository at this point in the history
etcdserver: make snaptest fail fast
  • Loading branch information
xiang90 authored Nov 3, 2016
2 parents aa526cd + 6a0a0a7 commit a0d206c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions etcdserver/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -862,17 +862,20 @@ func TestSnapshot(t *testing.T) {

go func() {
gaction, _ := p.Wait(1)
defer func() { ch <- struct{}{} }()

if len(gaction) != 1 {
t.Fatalf("len(action) = %d, want 1", len(gaction))
}
if !reflect.DeepEqual(gaction[0], testutil.Action{Name: "SaveSnap"}) {
t.Errorf("action = %s, want SaveSnap", gaction[0])
}
ch <- struct{}{}
}()

go func() {
gaction, _ := st.Wait(2)
defer func() { ch <- struct{}{} }()

if len(gaction) != 2 {
t.Fatalf("len(action) = %d, want 2", len(gaction))
}
Expand All @@ -882,7 +885,6 @@ func TestSnapshot(t *testing.T) {
if !reflect.DeepEqual(gaction[1], testutil.Action{Name: "SaveNoCopy"}) {
t.Errorf("action = %s, want SaveNoCopy", gaction[1])
}
ch <- struct{}{}
}()

srv.snapshot(1, raftpb.ConfState{Nodes: []uint64{1}})
Expand Down

0 comments on commit a0d206c

Please sign in to comment.