Skip autoscaling tests when we hit rate limits

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
This commit is contained in:
Davanum Srinivas 2024-02-24 18:07:49 -05:00
parent e2ff63103d
commit d7735f32d0
No known key found for this signature in database
GPG Key ID: 80D83A796103BF59
2 changed files with 10 additions and 0 deletions

View File

@ -420,6 +420,9 @@ func (tc *CustomMetricTestCase) Run(ctx context.Context) {
// Set up a cluster: create a custom metric and set up k8s-sd adapter
err = monitoring.CreateDescriptors(gcmService, projectID)
if err != nil {
if strings.Contains(err.Error(), "Request throttled") {
e2eskipper.Skipf("Skipping...hitting rate limits on creating and updating metrics/labels")
}
framework.Failf("Failed to create metric descriptor: %v", err)
}
defer monitoring.CleanupDescriptors(gcmService, projectID)

View File

@ -18,6 +18,7 @@ package monitoring
import (
"context"
"strings"
"time"
gcm "google.golang.org/api/monitoring/v3"
@ -112,6 +113,9 @@ func testCustomMetrics(ctx context.Context, f *framework.Framework, kubeClient c
// Set up a cluster: create a custom metric and set up k8s-sd adapter
err = CreateDescriptors(gcmService, projectID)
if err != nil {
if strings.Contains(err.Error(), "Request throttled") {
e2eskipper.Skipf("Skipping...hitting rate limits on creating and updating metrics/labels")
}
framework.Failf("Failed to create metric descriptor: %s", err)
}
ginkgo.DeferCleanup(CleanupDescriptors, gcmService, projectID)
@ -158,6 +162,9 @@ func testExternalMetrics(ctx context.Context, f *framework.Framework, kubeClient
// Set up a cluster: create a custom metric and set up k8s-sd adapter
err = CreateDescriptors(gcmService, projectID)
if err != nil {
if strings.Contains(err.Error(), "Request throttled") {
e2eskipper.Skipf("Skipping...hitting rate limits on creating and updating metrics/labels")
}
framework.Failf("Failed to create metric descriptor: %s", err)
}
ginkgo.DeferCleanup(CleanupDescriptors, gcmService, projectID)