Skip to content

Commit a95217d

Browse files
committed
Replace Get operations with polling and skip VAC tests during integration test
1 parent 82a4f6c commit a95217d

File tree

3 files changed

+15
-11
lines changed

3 files changed

+15
-11
lines changed

cmd/gce-pd-csi-driver/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ var (
5757
attachDiskBackoffJitter = flag.Float64("attach-disk-backoff-jitter", 0.0, "Jitter for attachDisk backoff")
5858
attachDiskBackoffSteps = flag.Int("attach-disk-backoff-steps", 24, "Steps for attachDisk backoff")
5959
attachDiskBackoffCap = flag.Duration("attach-disk-backoff-cap", 0, "Cap for attachDisk backoff")
60-
waitForOpBackoffDuration = flag.Duration("wait-op-backoff-duration", 3*time.Second, "Duration for wait for operation backoff")
60+
waitForOpBackoffDuration = flag.Duration("wait-op-backoff-duration", 2*time.Minute, "Duration for wait for operation backoff")
6161
waitForOpBackoffFactor = flag.Float64("wait-op-backoff-factor", 0.0, "Factor for wait for operation backoff")
6262
waitForOpBackoffJitter = flag.Float64("wait-op-backoff-jitter", 0.0, "Jitter for wait for operation backoff")
63-
waitForOpBackoffSteps = flag.Int("wait-op-backoff-steps", 100, "Steps for wait for operation backoff")
63+
waitForOpBackoffSteps = flag.Int("wait-op-backoff-steps", 3, "Steps for wait for operation backoff")
6464
waitForOpBackoffCap = flag.Duration("wait-op-backoff-cap", 0, "Cap for wait for operation backoff")
6565

6666
enableDeviceInUseCheck = flag.Bool("enable-device-in-use-check-on-node-unstage", true, "If set to true, block NodeUnstageVolume requests until the specified device is not in use")

pkg/gce-cloud-provider/compute/gce-compute.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,12 @@ var AttachDiskBackoff = wait.Backoff{
7676
Cap: 0}
7777

7878
// WaitForOpBackoff is backoff used to wait for Global, Regional or Zonal operation to complete.
79-
// Default values are similar to Poll every 3 seconds with 5 minute timeout.
79+
// Default values are similar to Poll every 2 minutes with 6 minute timeout.
8080
var WaitForOpBackoff = wait.Backoff{
81-
Duration: 3 * time.Second,
81+
Duration: 2 * time.Minute,
8282
Factor: 0.0,
8383
Jitter: 0.0,
84-
Steps: 100,
84+
Steps: 3,
8585
Cap: 0}
8686

8787
// Custom error type to propagate error messages up to clients.
@@ -1066,37 +1066,37 @@ func (cloud *CloudProvider) getRegionalDiskTypeURI(project string, region, diskT
10661066
func (cloud *CloudProvider) waitForZonalOp(ctx context.Context, project, opName string, zone string) error {
10671067
// The v1 API can query for v1, alpha, or beta operations.
10681068
return wait.ExponentialBackoff(WaitForOpBackoff, func() (bool, error) {
1069-
pollOp, err := cloud.service.ZoneOperations.Get(project, zone, opName).Context(ctx).Do()
1069+
waitOp, err := cloud.service.ZoneOperations.Wait(project, zone, opName).Context(ctx).Do()
10701070
if err != nil {
10711071
klog.Errorf("WaitForOp(op: %s, zone: %#v) failed to poll the operation", opName, zone)
10721072
return false, err
10731073
}
1074-
done, err := opIsDone(pollOp)
1074+
done, err := opIsDone(waitOp)
10751075
return done, err
10761076
})
10771077
}
10781078

10791079
func (cloud *CloudProvider) waitForRegionalOp(ctx context.Context, project, opName string, region string) error {
10801080
// The v1 API can query for v1, alpha, or beta operations.
10811081
return wait.ExponentialBackoff(WaitForOpBackoff, func() (bool, error) {
1082-
pollOp, err := cloud.service.RegionOperations.Get(project, region, opName).Context(ctx).Do()
1082+
waitOp, err := cloud.service.RegionOperations.Wait(project, region, opName).Context(ctx).Do()
10831083
if err != nil {
10841084
klog.Errorf("WaitForOp(op: %s, region: %#v) failed to poll the operation", opName, region)
10851085
return false, err
10861086
}
1087-
done, err := opIsDone(pollOp)
1087+
done, err := opIsDone(waitOp)
10881088
return done, err
10891089
})
10901090
}
10911091

10921092
func (cloud *CloudProvider) waitForGlobalOp(ctx context.Context, project, opName string) error {
10931093
return wait.ExponentialBackoff(WaitForOpBackoff, func() (bool, error) {
1094-
pollOp, err := cloud.service.GlobalOperations.Get(project, opName).Context(ctx).Do()
1094+
waitOp, err := cloud.service.GlobalOperations.Wait(project, opName).Context(ctx).Do()
10951095
if err != nil {
10961096
klog.Errorf("waitForGlobalOp(op: %s) failed to poll the operation", opName)
10971097
return false, err
10981098
}
1099-
done, err := opIsDone(pollOp)
1099+
done, err := opIsDone(waitOp)
11001100
return done, err
11011101
})
11021102
}

test/k8s-integration/main.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,8 @@ func generateGCETestSkip(testParams *testParameters) string {
639639
skipString := "\\[Disruptive\\]|\\[Serial\\]"
640640
// Skip mount options test until we fix the invalid mount options for xfs.
641641
skipString = skipString + "|csi-gcepd-sc-xfs.*provisioning.should.provision.storage.with.mount.options"
642+
// Skip VolumeAttributesClass tests while it's a beta feature.
643+
skipString = skipString + "|\\[Feature:VolumeAttributesClass\\]"
642644

643645
v := apimachineryversion.MustParseSemantic(testParams.clusterVersion)
644646

@@ -745,6 +747,8 @@ func generateGKETestSkip(testParams *testParameters) string {
745747

746748
// Skip mount options test until we fix the invalid mount options for xfs.
747749
skipString = skipString + "|csi-gcepd-sc-xfs.*provisioning.should.provision.storage.with.mount.options"
750+
// Skip VolumeAttributesClass tests while it's a beta feature.
751+
skipString = skipString + "|\\[Feature:VolumeAttributesClass\\]"
748752

749753
// Skip rwop test when node version is less than 1.32. Test was added only
750754
// in 1.32 and above, see tags in

0 commit comments

Comments
 (0)