File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,8 @@ import (
2323 "testing"
2424 "time"
2525
26+ "github.com/stretchr/testify/assert"
27+
2628 "vitess.io/vitess/go/vt/topo/topoproto"
2729 "vitess.io/vitess/go/vt/vterrors"
2830
6870 }
6971)
7072
73+ func TestIsErrorDueToReparenting (t * testing.T ) {
74+ testcases := []struct {
75+ err error
76+ want bool
77+ }{
78+ {
79+ err : vterrors .Errorf (vtrpcpb .Code_CLUSTER_EVENT , ClusterEventReshardingInProgress ),
80+ want : false ,
81+ },
82+ {
83+ err : vterrors .Errorf (vtrpcpb .Code_CLUSTER_EVENT , ClusterEventReparentInProgress ),
84+ want : true ,
85+ },
86+ {
87+ err : vterrors .Errorf (vtrpcpb .Code_CLUSTER_EVENT , "The MySQL server is running with the --super-read-only option" ),
88+ want : true ,
89+ },
90+ }
91+ for _ , tt := range testcases {
92+ t .Run (tt .err .Error (), func (t * testing.T ) {
93+ got := IsErrorDueToReparenting (tt .err )
94+ assert .Equal (t , tt .want , got )
95+ })
96+ }
97+ }
98+
7199func TestBuffering (t * testing.T ) {
72100 testAllImplementations (t , testBuffering1 )
73101}
You can’t perform that action at this time.
0 commit comments