Skip to content

Commit a25393b

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

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

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

Lines changed: 6 additions & 6 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,7 +1066,7 @@ 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+
pollOp, 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
@@ -1079,7 +1079,7 @@ func (cloud *CloudProvider) waitForZonalOp(ctx context.Context, project, opName
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+
pollOp, 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
@@ -1091,7 +1091,7 @@ func (cloud *CloudProvider) waitForRegionalOp(ctx context.Context, project, opNa
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+
pollOp, 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

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)