Skip to content

Commit 1482328

Browse files
author
Dhriti Chopra
committed
test(storage): bind FakeServer and TestBench to 127.0.0.1 to avoid localhost IPv6 hangs
1 parent 16cff56 commit 1482328

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

java-storage/google-cloud-storage/src/test/java/com/google/cloud/storage/FakeServer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public void close() throws InterruptedException {
5454
}
5555

5656
static FakeServer of(StorageGrpc.StorageImplBase service) throws IOException {
57-
InetSocketAddress address = new InetSocketAddress("localhost", 0);
57+
InetSocketAddress address = new InetSocketAddress("127.0.0.1", 0);
5858
Server server = NettyServerBuilder.forAddress(address).addService(service).build();
5959
server.start();
6060
String endpoint = String.format(Locale.US, "%s:%d", address.getHostString(), server.getPort());

java-storage/google-cloud-storage/src/test/java/com/google/cloud/storage/it/runner/registry/TestBench.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -442,8 +442,8 @@ public String toString() {
442442
}
443443

444444
static final class Builder {
445-
private static final String DEFAULT_BASE_URI = "http://localhost:9000";
446-
private static final String DEFAULT_GRPC_BASE_URI = "http://localhost:9005";
445+
private static final String DEFAULT_BASE_URI = "http://127.0.0.1:9000";
446+
private static final String DEFAULT_GRPC_BASE_URI = "http://127.0.0.1:9005";
447447
private static final String DEFAULT_IMAGE_NAME;
448448
private static final String DEFAULT_IMAGE_TAG;
449449

0 commit comments

Comments
 (0)