diff --git a/plugins/repository-gcs/qa/google-cloud-storage/build.gradle b/plugins/repository-gcs/qa/google-cloud-storage/build.gradle index d1a5f067b96de..890e179f49c71 100644 --- a/plugins/repository-gcs/qa/google-cloud-storage/build.gradle +++ b/plugins/repository-gcs/qa/google-cloud-storage/build.gradle @@ -128,7 +128,7 @@ integTest.mustRunAfter(thirdPartyTest) * an additional test that forces the large blob threshold to be small to exercise the resumable upload path. */ task largeBlobIntegTest(type: RestIntegTestTask) { - mustRunAfter(thirdPartyTest) + mustRunAfter(thirdPartyTest, integTest) } check.dependsOn integTest @@ -159,6 +159,7 @@ final Closure testClustersConfiguration = { if (useFixture) { tasks.integTest.dependsOn createServiceAccountFile + tasks.largeBlobIntegTest.dependsOn createServiceAccountFile /* Use a closure on the string to delay evaluation until tests are executed */ setting 'gcs.client.integration_test.endpoint', { "${-> fixtureAddress('gcs-fixture')}" }, IGNORE_VALUE setting 'gcs.client.integration_test.token_uri', { "${-> fixtureAddress('gcs-fixture')}/o/oauth2/token" }, IGNORE_VALUE diff --git a/test/fixtures/gcs-fixture/src/main/java/fixture/gcs/GoogleCloudStorageHttpHandler.java b/test/fixtures/gcs-fixture/src/main/java/fixture/gcs/GoogleCloudStorageHttpHandler.java index b907cb289bea6..ff19ecca25881 100644 --- a/test/fixtures/gcs-fixture/src/main/java/fixture/gcs/GoogleCloudStorageHttpHandler.java +++ b/test/fixtures/gcs-fixture/src/main/java/fixture/gcs/GoogleCloudStorageHttpHandler.java @@ -31,7 +31,6 @@ import org.elasticsearch.common.bytes.CompositeBytesReference; import org.elasticsearch.common.collect.Tuple; import org.elasticsearch.common.io.Streams; -import org.elasticsearch.common.network.InetAddresses; import org.elasticsearch.common.regex.Regex; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.rest.RestUtils; @@ -40,7 +39,6 @@ import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; -import java.net.InetSocketAddress; import java.net.URLDecoder; import java.util.ArrayList; import java.util.HashMap; @@ -259,8 +257,7 @@ public Map blobs() { } private String httpServerUrl(final HttpExchange exchange) { - final InetSocketAddress address = exchange.getLocalAddress(); - return "http://" + InetAddresses.toUriString(address.getAddress()) + ":" + address.getPort(); + return "http://" + exchange.getRequestHeaders().get("HOST").get(0); } private static final Pattern NAME_PATTERN = Pattern.compile("\"name\":\"([^\"]*)\"");