mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 04:33:26 +00:00
Skip autoscaling tests when we hit rate limits
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
This commit is contained in:
parent
e2ff63103d
commit
d7735f32d0
@ -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)
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user