Skip to content

Commit f681af6

Browse files
authored
Reduce GCP fixture token fetch failures count (elastic#140807)
1 parent b13ea18 commit f681af6

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

modules/repository-gcs/src/internalClusterTest/java/org/elasticsearch/repositories/gcs/GoogleCloudStorageBlobStoreRepositoryTests.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,13 @@ protected Map<String, HttpHandler> createHttpHandlers() {
114114
);
115115
}
116116

117+
// GCP Oauth2 client uses own retries: 1-second initial delay, 3-tries, 2x multiplier
118+
// it can take long time to pass through(>10s) from multiple nodes, and trip tests with timeouts
119+
// https://github.com/googleapis/google-auth-library-java/blob/main/oauth2_http/java/com/google/auth/oauth2/OAuth2Utils.java#L115-L118
117120
@Override
118121
protected HttpHandler createErroneousHttpHandler(final HttpHandler delegate) {
119122
if (delegate instanceof FakeOAuth2HttpHandler) {
120-
return new GoogleErroneousHttpHandler(delegate, randomIntBetween(2, 3));
123+
return new GoogleErroneousHttpHandler(delegate, 1);
121124
} else {
122125
return new GoogleCloudStorageStatsCollectorHttpHandler(new GoogleErroneousHttpHandler(delegate, randomIntBetween(2, 3)));
123126
}

test/framework/src/main/java/org/elasticsearch/repositories/blobstore/ESMockAPIBasedRepositoryIntegTestCase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ protected ErroneousHttpHandler(final HttpHandler delegate, final int maxErrorsPe
291291
this.requests = new ConcurrentHashMap<>();
292292
this.delegate = delegate;
293293
this.maxErrorsPerRequest = maxErrorsPerRequest;
294-
assert maxErrorsPerRequest > 1;
294+
assert maxErrorsPerRequest > 0;
295295
}
296296

297297
@Override

0 commit comments

Comments
 (0)