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:
Clayton Coleman 2023-03-10 11:02:59 -06:00
parent 087868a436
commit 8d4004bbc7
No known key found for this signature in database
GPG Key ID: CF7DB7FC943D3E0E
3 changed files with 5 additions and 3 deletions

View File

@ -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,
},
{

View File

@ -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",

View File

@ -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",