diff --git a/google-cloud-storage/src/main/java/com/google/cloud/storage/GrpcStorageOptions.java b/google-cloud-storage/src/main/java/com/google/cloud/storage/GrpcStorageOptions.java index 47dabe11f1..10d7066987 100644 --- a/google-cloud-storage/src/main/java/com/google/cloud/storage/GrpcStorageOptions.java +++ b/google-cloud-storage/src/main/java/com/google/cloud/storage/GrpcStorageOptions.java @@ -689,7 +689,7 @@ public Duration getTerminationAwaitDuration() { /** @since 2.14.0 This new api is in preview and is subject to breaking changes. */ @BetaApi public boolean isAttemptDirectPath() { - return false; + return true; } /** @since 2.41.0 This new api is in preview and is subject to breaking changes. */ diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/FakeServer.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/FakeServer.java index 331856c4d0..74b1283cd8 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/FakeServer.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/FakeServer.java @@ -61,6 +61,7 @@ static FakeServer of(StorageGrpc.StorageImplBase service) throws IOException { .setCredentials(NoCredentials.getInstance()) .setGrpcInterceptorProvider(GrpcPlainRequestLoggingInterceptor.getInterceptorProvider()) .setEnableGrpcClientMetrics(false) + .setAttemptDirectPath(false) .build(); return new FakeServer(server, grpcStorageOptions); } diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/ITStorageLifecycleTest.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/ITStorageLifecycleTest.java index 1c404ec973..4b4e497cc7 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/ITStorageLifecycleTest.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/ITStorageLifecycleTest.java @@ -51,6 +51,7 @@ public void grpc() throws Exception { .setCredentials(NoCredentials.getInstance()) .setProjectId("test-project-id") .setEnableGrpcClientMetrics(false) + .setAttemptDirectPath(false) .build(); Storage service1 = options.getService(); diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RetryTestFixture.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RetryTestFixture.java index 3076b171be..38c1f89934 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RetryTestFixture.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/conformance/retry/RetryTestFixture.java @@ -160,7 +160,8 @@ private Storage newStorage(boolean forTest) { builder = StorageOptions.grpc() .setHost(testBench.getGRPCBaseUri()) - .setEnableGrpcClientMetrics(false); + .setEnableGrpcClientMetrics(false) + .setAttemptDirectPath(false); break; default: throw new IllegalStateException( diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITGrpcIdempotencyTokenTest.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITGrpcIdempotencyTokenTest.java index 0aca897aff..f6cfb5a35e 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITGrpcIdempotencyTokenTest.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/ITGrpcIdempotencyTokenTest.java @@ -69,6 +69,7 @@ public void setUp() throws Exception { StorageOptions.grpc() .setGrpcInterceptorProvider(() -> ImmutableList.of(requestAuditing)) .setEnableGrpcClientMetrics(false) + .setAttemptDirectPath(false) .build() .getService(); } diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/StorageNativeCanary.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/StorageNativeCanary.java index 534764d9b1..651f012482 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/StorageNativeCanary.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/StorageNativeCanary.java @@ -57,7 +57,12 @@ public void canary_happyPath_http() throws Exception { @Test public void canary_happyPath_grpc() throws Exception { - assertBehaviorOfPrimaryStorageActions(StorageOptions.grpc().build().getService()); + assertBehaviorOfPrimaryStorageActions( + StorageOptions.grpc() + // TODO https://github.com/googleapis/java-storage/issues/2716 + .setAttemptDirectPath(false) + .build() + .getService()); } /** diff --git a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/runner/registry/BackendResources.java b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/runner/registry/BackendResources.java index 9739abcc3f..28a7b87737 100644 --- a/google-cloud-storage/src/test/java/com/google/cloud/storage/it/runner/registry/BackendResources.java +++ b/google-cloud-storage/src/test/java/com/google/cloud/storage/it/runner/registry/BackendResources.java @@ -118,6 +118,7 @@ static BackendResources of(Backend backend) { .setGrpcInterceptorProvider( GrpcPlainRequestLoggingInterceptor.getInterceptorProvider()) .setEnableGrpcClientMetrics(false) + .setAttemptDirectPath(false) .build(); return new StorageInstance(built, protectedBucketNames); });