@@ -667,24 +667,14 @@ func TestSnapshotDisk(t *testing.T) {
667
667
gaction , _ := p .Wait (2 )
668
668
defer func () { ch <- struct {}{} }()
669
669
670
- if len (gaction ) != 2 {
671
- t .Errorf ("len(action) = %d, want 2" , len (gaction ))
672
- return
673
- }
674
- if ! reflect .DeepEqual (gaction [0 ], testutil.Action {Name : "SaveSnap" }) {
675
- t .Errorf ("action = %s, want SaveSnap" , gaction [0 ])
676
- }
677
-
678
- if ! reflect .DeepEqual (gaction [1 ], testutil.Action {Name : "Release" }) {
679
- t .Errorf ("action = %s, want Release" , gaction [1 ])
680
- }
670
+ assert .Len (t , gaction , 2 )
671
+ assert .Equal (t , testutil.Action {Name : "SaveSnap" }, gaction [0 ])
672
+ assert .Equal (t , testutil.Action {Name : "Release" }, gaction [1 ])
681
673
}()
682
674
ep := etcdProgress {appliedi : 1 , confState : raftpb.ConfState {Voters : []uint64 {1 }}}
683
675
srv .snapshot (& ep , true )
684
676
<- ch
685
- if len (st .Action ()) != 0 {
686
- t .Errorf ("no action expected on v2store. Got %d actions" , len (st .Action ()))
687
- }
677
+ assert .Empty (t , st .Action ())
688
678
assert .Equal (t , uint64 (1 ), ep .diskSnapshotIndex )
689
679
assert .Equal (t , uint64 (1 ), ep .memorySnapshotIndex )
690
680
}
@@ -728,17 +718,12 @@ func TestSnapshotMemory(t *testing.T) {
728
718
gaction , _ := p .Wait (1 )
729
719
defer func () { ch <- struct {}{} }()
730
720
731
- if len (gaction ) != 0 {
732
- t .Errorf ("len(action) = %d, want 0" , len (gaction ))
733
- return
734
- }
721
+ assert .Empty (t , gaction )
735
722
}()
736
723
ep := etcdProgress {appliedi : 1 , confState : raftpb.ConfState {Voters : []uint64 {1 }}}
737
724
srv .snapshot (& ep , false )
738
725
<- ch
739
- if len (st .Action ()) != 0 {
740
- t .Errorf ("no action expected on v2store. Got %d actions" , len (st .Action ()))
741
- }
726
+ assert .Empty (t , st .Action ())
742
727
assert .Equal (t , uint64 (0 ), ep .diskSnapshotIndex )
743
728
assert .Equal (t , uint64 (1 ), ep .memorySnapshotIndex )
744
729
}
0 commit comments