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