Merge pull request #107770 from brianpursley/timeout-test-2
Fix wrong status code in unit test error messages and replace deprecated function call Kubernetes-commit: 36431ae396c753ed01aa334191a85c777821d2c7
This commit is contained in:
commit
9b9d7d3080
8
go.mod
8
go.mod
|
@ -43,9 +43,9 @@ require (
|
|||
google.golang.org/grpc v1.40.0
|
||||
gopkg.in/natefinch/lumberjack.v2 v2.0.0
|
||||
gopkg.in/square/go-jose.v2 v2.2.2
|
||||
k8s.io/api v0.0.0-20220205134657-8a75781aba70
|
||||
k8s.io/api v0.0.0-20220208215310-67a3496afcb4
|
||||
k8s.io/apimachinery v0.0.0-20220129104801-df993592a122
|
||||
k8s.io/client-go v0.0.0-20220202172021-8f44946f6cbe
|
||||
k8s.io/client-go v0.0.0-20220208215616-6964e37acfd3
|
||||
k8s.io/component-base v0.0.0-20220208095537-e7d894918532
|
||||
k8s.io/klog/v2 v2.40.1
|
||||
k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65
|
||||
|
@ -57,8 +57,8 @@ require (
|
|||
)
|
||||
|
||||
replace (
|
||||
k8s.io/api => k8s.io/api v0.0.0-20220205134657-8a75781aba70
|
||||
k8s.io/api => k8s.io/api v0.0.0-20220208215310-67a3496afcb4
|
||||
k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20220129104801-df993592a122
|
||||
k8s.io/client-go => k8s.io/client-go v0.0.0-20220202172021-8f44946f6cbe
|
||||
k8s.io/client-go => k8s.io/client-go v0.0.0-20220208215616-6964e37acfd3
|
||||
k8s.io/component-base => k8s.io/component-base v0.0.0-20220208095537-e7d894918532
|
||||
)
|
||||
|
|
8
go.sum
8
go.sum
|
@ -956,12 +956,12 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh
|
|||
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
|
||||
honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
|
||||
honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
|
||||
k8s.io/api v0.0.0-20220205134657-8a75781aba70 h1:jgiY6siw9lOsdz5+NyVqJ+FY9vqaebm9jVUKXG9R1Pg=
|
||||
k8s.io/api v0.0.0-20220205134657-8a75781aba70/go.mod h1:X9EhUlkE1ihYyDWan4d+RhC/Au1Ha1sbt7DTzvBz8vY=
|
||||
k8s.io/api v0.0.0-20220208215310-67a3496afcb4 h1:H2u8SQ1FSRIrs/Xo1LIRb40EGEAnQq4stBT7BE2vma0=
|
||||
k8s.io/api v0.0.0-20220208215310-67a3496afcb4/go.mod h1:X9EhUlkE1ihYyDWan4d+RhC/Au1Ha1sbt7DTzvBz8vY=
|
||||
k8s.io/apimachinery v0.0.0-20220129104801-df993592a122 h1:14bzAwJDW8S86wqAvH5sVjI1ilnCWnAKWXomMStJ3Yo=
|
||||
k8s.io/apimachinery v0.0.0-20220129104801-df993592a122/go.mod h1:x0yrIIAdS2/JR9TKFHtSn8dYQDIw8mTIeAqPvOuEozA=
|
||||
k8s.io/client-go v0.0.0-20220202172021-8f44946f6cbe h1:kfSVh0XrUy2OG1lDWJQ3lbAcaU6RLUIRwWq5XMBYkEE=
|
||||
k8s.io/client-go v0.0.0-20220202172021-8f44946f6cbe/go.mod h1:zv+Q8PFPKv1qDtAejKxTIGRAiO7e29b9fFGd5JiXjFQ=
|
||||
k8s.io/client-go v0.0.0-20220208215616-6964e37acfd3 h1:1zoBQyUtf/HuwJEW2elKTWkw/0ix1Kul5zppTvRXZ3I=
|
||||
k8s.io/client-go v0.0.0-20220208215616-6964e37acfd3/go.mod h1:lkfKgSyz466P2/52WRUQ7h+JUT3fpeneZY8XKrvSHyY=
|
||||
k8s.io/component-base v0.0.0-20220208095537-e7d894918532 h1:7nW06PEXRrTozkLcWQxMsrEfl1pugNfQ7cSvsvZiKo4=
|
||||
k8s.io/component-base v0.0.0-20220208095537-e7d894918532/go.mod h1:mD5XT/drYu0z4D/UnxDjUnRlaCXBlo4Vh5bQuMp1nmY=
|
||||
k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E=
|
||||
|
|
|
@ -36,12 +36,12 @@ import (
|
|||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/google/go-cmp/cmp"
|
||||
"golang.org/x/net/http2"
|
||||
|
||||
apierrors "k8s.io/apimachinery/pkg/api/errors"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/apimachinery/pkg/util/diff"
|
||||
"k8s.io/apimachinery/pkg/util/runtime"
|
||||
"k8s.io/apimachinery/pkg/util/sets"
|
||||
"k8s.io/apiserver/pkg/endpoints/request"
|
||||
|
@ -143,7 +143,7 @@ func TestTimeout(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
if res.StatusCode != http.StatusGatewayTimeout {
|
||||
t.Errorf("got res.StatusCode %d; expected %d", res.StatusCode, http.StatusServiceUnavailable)
|
||||
t.Errorf("got res.StatusCode %d; expected %d", res.StatusCode, http.StatusGatewayTimeout)
|
||||
}
|
||||
body, _ = ioutil.ReadAll(res.Body)
|
||||
status := &metav1.Status{}
|
||||
|
@ -151,7 +151,7 @@ func TestTimeout(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
if !reflect.DeepEqual(status, &timeoutErr.ErrStatus) {
|
||||
t.Errorf("unexpected object: %s", diff.ObjectReflectDiff(&timeoutErr.ErrStatus, status))
|
||||
t.Errorf("unexpected object: %s", cmp.Diff(&timeoutErr.ErrStatus, status))
|
||||
}
|
||||
if record.Count() != 1 {
|
||||
t.Errorf("did not invoke record method: %#v", record)
|
||||
|
@ -250,7 +250,7 @@ func TestTimeoutHeaders(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
if res.StatusCode != http.StatusGatewayTimeout {
|
||||
t.Errorf("got res.StatusCode %d; expected %d", res.StatusCode, http.StatusServiceUnavailable)
|
||||
t.Errorf("got res.StatusCode %d; expected %d", res.StatusCode, http.StatusGatewayTimeout)
|
||||
}
|
||||
res.Body.Close()
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue