From 3927dfd113fd101764aa91e0bd9098dbcf077166 Mon Sep 17 00:00:00 2001 From: Martijn van Schaardenburg Date: Tue, 30 May 2023 15:23:48 -0600 Subject: [PATCH] Testing: Retry Trace/Monitoring API quota errors (#1222) --- integration_test/gce/gce_testing.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/integration_test/gce/gce_testing.go b/integration_test/gce/gce_testing.go index ad0258199a..cd8caa730d 100644 --- a/integration_test/gce/gce_testing.go +++ b/integration_test/gce/gce_testing.go @@ -392,7 +392,9 @@ func isRetriableLookupError(err error) bool { // workload.googleapis.com/* domain metrics are created on first write, and may not be immediately queryable. // The error doesn't always look the same, hopefully looking for Code() == NotFound will catch all variations. // The Internal case catches some transient errors returned by the monitoring API sometimes. - return ok && (myStatus.Code() == codes.NotFound || myStatus.Code() == codes.Internal) + // The ResourceExhausted case catches API quota errors like: + // https://source.cloud.google.com/results/invocations/863be0a0-fa7c-4dab-a8df-7689d91513a7. + return ok && (myStatus.Code() == codes.NotFound || myStatus.Code() == codes.Internal || myStatus.Code() == codes.ResourceExhausted) } // lookupMetric does a single lookup of the given metric in the backend.