Merge pull request #123488 from dims/skip-autoscaling-tests-when-we-hit-rate-limits

Skip autoscaling tests when we hit rate limits
This commit is contained in:
Kubernetes Prow Robot
2024-02-25 06:40:24 -08:00
committed by GitHub
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)