clientv3: convert errors to rpctypes on returning
For https://github.com/coreos/etcd/issues/5211.
This commit is contained in:
@ -55,16 +55,16 @@ func TestDialTimeout(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestIsHalted(t *testing.T) {
|
||||
if !isHalted(nil, fmt.Errorf("etcdserver: some etcdserver error")) {
|
||||
func TestIsHaltErr(t *testing.T) {
|
||||
if !isHaltErr(nil, fmt.Errorf("etcdserver: some etcdserver error")) {
|
||||
t.Errorf(`error prefixed with "etcdserver: " should be Halted`)
|
||||
}
|
||||
ctx, cancel := context.WithCancel(context.TODO())
|
||||
if isHalted(ctx, nil) {
|
||||
if isHaltErr(ctx, nil) {
|
||||
t.Errorf("no error and active context should not be Halted")
|
||||
}
|
||||
cancel()
|
||||
if !isHalted(ctx, nil) {
|
||||
if !isHaltErr(ctx, nil) {
|
||||
t.Errorf("cancel on context should be Halted")
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user