Fix GCS tests broken by idempotency token (#126972)

This commit is contained in:
Nick Tindall 2025-04-17 12:42:32 +10:00 committed by GitHub
parent 270ca0a80a
commit d378185054
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 13 deletions

View file

@ -343,7 +343,15 @@ public class GoogleCloudStorageBlobStoreRepositoryTests extends ESMockAPIBasedRe
}
if (exchange.getRequestHeaders().containsKey(IDEMPOTENCY_TOKEN)) {
return exchange.getRequestHeaders().getFirst(IDEMPOTENCY_TOKEN);
String idempotencyToken = exchange.getRequestHeaders().getFirst(IDEMPOTENCY_TOKEN);
// In the event of a resumable retry, the GCS client uses the same idempotency token for
// the retry status check and the subsequent retries.
// Including the range header allows us to disambiguate between the requests
// see https://github.com/googleapis/java-storage/issues/3040
if (exchange.getRequestHeaders().containsKey("Content-Range")) {
idempotencyToken += " " + exchange.getRequestHeaders().getFirst("Content-Range");
}
return idempotencyToken;
}
final String range = exchange.getRequestHeaders().getFirst("Content-Range");

View file

@ -405,18 +405,6 @@ tests:
- class: org.elasticsearch.xpack.test.rest.XPackRestIT
method: test {p0=ml/inference_crud/Test delete given unused trained model}
issue: https://github.com/elastic/elasticsearch/issues/126881
- class: org.elasticsearch.repositories.gcs.GoogleCloudStorageBlobStoreRepositoryTests
method: testRequestStats
issue: https://github.com/elastic/elasticsearch/issues/126902
- class: org.elasticsearch.repositories.gcs.GoogleCloudStorageBlobStoreRepositoryTests
method: testWriteReadLarge
issue: https://github.com/elastic/elasticsearch/issues/126903
- class: org.elasticsearch.repositories.gcs.GoogleCloudStorageBlobStoreRepositoryTests
method: testWriteFileMultipleOfChunkSize
issue: https://github.com/elastic/elasticsearch/issues/126908
- class: org.elasticsearch.repositories.gcs.GoogleCloudStorageBlobStoreRepositoryTests
method: testSnapshotWithLargeSegmentFiles
issue: https://github.com/elastic/elasticsearch/issues/126909
- class: org.elasticsearch.index.engine.CompletionStatsCacheTests
method: testCompletionStatsCache
issue: https://github.com/elastic/elasticsearch/issues/126910