mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
client: Fix tests for latest golang
This commit is contained in:
parent
216808eab5
commit
867b45d865
@ -422,7 +422,7 @@ func TestHTTPClusterClientDo(t *testing.T) {
|
||||
tt.ctx = context.Background()
|
||||
}
|
||||
resp, _, err := tt.client.Do(tt.ctx, nil)
|
||||
if !reflect.DeepEqual(tt.wantErr, err) {
|
||||
if (tt.wantErr == nil && tt.wantErr != err) || (tt.wantErr != nil && tt.wantErr.Error() != err.Error()) {
|
||||
t.Errorf("#%d: got err=%v, want=%v", i, err, tt.wantErr)
|
||||
continue
|
||||
}
|
||||
@ -726,7 +726,7 @@ func TestRedirectFollowingHTTPClient(t *testing.T) {
|
||||
for i, tt := range tests {
|
||||
client := &redirectFollowingHTTPClient{client: tt.client, checkRedirect: tt.checkRedirect}
|
||||
resp, _, err := client.Do(context.Background(), nil)
|
||||
if !reflect.DeepEqual(tt.wantErr, err) {
|
||||
if (tt.wantErr == nil && tt.wantErr != err) || (tt.wantErr != nil && tt.wantErr.Error() != err.Error()) {
|
||||
t.Errorf("#%d: got err=%v, want=%v", i, err, tt.wantErr)
|
||||
continue
|
||||
}
|
||||
|
@ -994,12 +994,13 @@ func TestHTTPKeysAPIWatcherAction(t *testing.T) {
|
||||
}
|
||||
|
||||
for i, tt := range tests {
|
||||
testError := errors.New("fail!")
|
||||
kAPI := &httpKeysAPI{
|
||||
client: &staticHTTPClient{err: errors.New("fail!")},
|
||||
client: &staticHTTPClient{err: testError},
|
||||
}
|
||||
|
||||
want := &httpWatcher{
|
||||
client: &staticHTTPClient{err: errors.New("fail!")},
|
||||
client: &staticHTTPClient{err: testError},
|
||||
nextWait: tt.want,
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user