mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 19:31:44 +00:00
wait: Update tests to reference the constant error
The structure of the error is changing, and we don't guarantee reflect.DeepEqual(...) will remain true for ErrWaitTimeout currently.
This commit is contained in:
parent
087868a436
commit
8d4004bbc7
@ -209,7 +209,7 @@ func TestUntilWithSync(t *testing.T) {
|
||||
conditionFunc: func(e watch.Event) (bool, error) {
|
||||
return true, nil
|
||||
},
|
||||
expectedErr: errors.New("timed out waiting for the condition"),
|
||||
expectedErr: wait.ErrWaitTimeout,
|
||||
expectedEvent: nil,
|
||||
},
|
||||
{
|
||||
|
@ -34,6 +34,7 @@ import (
|
||||
|
||||
v1 "k8s.io/api/core/v1"
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
"k8s.io/apimachinery/pkg/util/wait"
|
||||
cloudprovider "k8s.io/cloud-provider"
|
||||
azcache "k8s.io/legacy-cloud-providers/azure/cache"
|
||||
"k8s.io/legacy-cloud-providers/azure/clients/interfaceclient/mockinterfaceclient"
|
||||
@ -487,7 +488,7 @@ func TestNodeAddresses(t *testing.T) {
|
||||
metadataName: "vm1",
|
||||
vmType: vmTypeStandard,
|
||||
useInstanceMetadata: true,
|
||||
expectedErrMsg: fmt.Errorf("timed out waiting for the condition"),
|
||||
expectedErrMsg: wait.ErrWaitTimeout,
|
||||
},
|
||||
{
|
||||
name: "NodeAddresses should get IP addresses from Azure API if node's name isn't equal to metadataName",
|
||||
|
@ -33,6 +33,7 @@ import (
|
||||
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
"k8s.io/apimachinery/pkg/util/sets"
|
||||
"k8s.io/apimachinery/pkg/util/wait"
|
||||
cloudprovider "k8s.io/cloud-provider"
|
||||
"k8s.io/legacy-cloud-providers/azure/clients/routetableclient/mockroutetableclient"
|
||||
"k8s.io/legacy-cloud-providers/azure/mockvmsets"
|
||||
@ -226,7 +227,7 @@ func TestCreateRoute(t *testing.T) {
|
||||
name: "CreateRoute should report error if error occurs when invoke GetIPByNodeName",
|
||||
routeTableName: "rt7",
|
||||
getIPError: fmt.Errorf("getIP error"),
|
||||
expectedErrMsg: fmt.Errorf("timed out waiting for the condition"),
|
||||
expectedErrMsg: wait.ErrWaitTimeout,
|
||||
},
|
||||
{
|
||||
name: "CreateRoute should add route to cloud.RouteCIDRs if node is unmanaged",
|
||||
|
Loading…
Reference in New Issue
Block a user