Skip to content

Commit

Permalink
test: fix test failure due to k8s lib change
Browse files Browse the repository at this point in the history
fix
  • Loading branch information
andyzhangx committed Jul 13, 2024
1 parent 659fae5 commit f1d90a5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pkg/azurefile/controllerserver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ func TestCreateVolume(t *testing.T) {
},
},
{
name: "No valid key with zero request gib",
name: "fileServicePropertiesCache is nil",
testFunc: func(t *testing.T) {
name := "baz"
sku := "sku"
Expand Down Expand Up @@ -735,7 +735,7 @@ func TestCreateVolume(t *testing.T) {
mockFileClient.EXPECT().GetServiceProperties(context.TODO(), gomock.Any(), gomock.Any()).Return(fileServiceProperties, nil).AnyTimes()
mockFileClient.EXPECT().SetServiceProperties(context.TODO(), gomock.Any(), gomock.Any(), gomock.Any()).Return(fileServiceProperties, nil).AnyTimes()

expectedErr := fmt.Errorf("no valid keys")
expectedErr := fmt.Errorf("failed to ensure storage account: fileServicePropertiesCache is nil")

_, err := d.CreateVolume(ctx, req)
if !strings.Contains(err.Error(), expectedErr.Error()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package testsuites
import (
"context"
"fmt"
"time"

"sigs.k8s.io/azurefile-csi-driver/test/e2e/driver"

Expand Down Expand Up @@ -50,7 +51,7 @@ func (t *DynamicallyProvisionedCmdVolumeTest) Run(ctx context.Context, client cl
defer tpod.Cleanup(ctx)
ginkgo.By("checking that the pods command exits with no error")
if pod.WinServerVer == "windows-2022" {
if err := e2epod.WaitForPodSuccessInNamespaceSlow(ctx, tpod.client, tpod.pod.Name, tpod.namespace.Name); err != nil {
if err := e2epod.WaitForPodSuccessInNamespaceTimeout(ctx, tpod.client, tpod.pod.Name, tpod.namespace.Name, 15*time.Minute); err != nil {
ginkgo.By(fmt.Sprintf("hit error(%v) in first run, give another try", err))
}
tpod.WaitForSuccess(ctx)
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/testsuites/testsuites.go
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ func (t *TestPod) Create(ctx context.Context) {
}

func (t *TestPod) WaitForSuccess(ctx context.Context) {
err := e2epod.WaitForPodSuccessInNamespaceSlow(ctx, t.client, t.pod.Name, t.namespace.Name)
err := e2epod.WaitForPodSuccessInNamespaceTimeout(ctx, t.client, t.pod.Name, t.namespace.Name, 15*time.Minute)
framework.ExpectNoError(err)
}

Expand Down

0 comments on commit f1d90a5

Please sign in to comment.