From fafe22a3f2c2e39c534829115c39da5d2eeab445 Mon Sep 17 00:00:00 2001 From: Diego Alonso Marquez Palacios Date: Thu, 21 Nov 2024 14:56:06 -0500 Subject: [PATCH] fix units --- .../cloud/spanner/BatchCreateSessionsSlowTest.java | 1 - .../cloud/spanner/DatabaseClientImplTest.java | 6 ++++-- .../google/cloud/spanner/SpannerOptionsTest.java | 14 +++++++------- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/BatchCreateSessionsSlowTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/BatchCreateSessionsSlowTest.java index 5b65dd8cf16..72d04d94614 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/BatchCreateSessionsSlowTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/BatchCreateSessionsSlowTest.java @@ -194,7 +194,6 @@ public void testBatchCreateSessionsTimesOut_whenResourceExhausted() throws Excep List> futures = new ArrayList<>(5000); AtomicInteger counter = new AtomicInteger(); for (int i = 0; i < 5000; i++) { - final int index = i; futures.add( service.submit( () -> { diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/DatabaseClientImplTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/DatabaseClientImplTest.java index cdb60bf1443..86d0bfc2c94 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/DatabaseClientImplTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/DatabaseClientImplTest.java @@ -2868,7 +2868,8 @@ public void testPartitionedDmlDoesNotTimeout() { DatabaseClient client = spanner.getDatabaseClient(DatabaseId.of(TEST_PROJECT, TEST_INSTANCE, TEST_DATABASE)); - assertThat(spanner.getOptions().getPartitionedDmlTimeout()).isEqualTo(Duration.ofHours(2L)); + assertThat(spanner.getOptions().getPartitionedDmlTimeoutDuration()) + .isEqualTo(Duration.ofHours(2L)); // PDML should not timeout with these settings. long updateCount = client.executePartitionedUpdate(UPDATE_STATEMENT); @@ -2904,7 +2905,8 @@ public void testPartitionedDmlWithLowerTimeout() { try (Spanner spanner = builder.build().getService()) { DatabaseClient client = spanner.getDatabaseClient(DatabaseId.of(TEST_PROJECT, TEST_INSTANCE, TEST_DATABASE)); - assertThat(spanner.getOptions().getPartitionedDmlTimeout()).isEqualTo(Duration.ofMillis(10L)); + assertThat(spanner.getOptions().getPartitionedDmlTimeoutDuration()) + .isEqualTo(Duration.ofMillis(10L)); // PDML should time out with these settings. mockSpanner.setExecuteSqlExecutionTime( SimulatedExecutionTime.ofMinimumAndRandomTime(1000, 0)); diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SpannerOptionsTest.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SpannerOptionsTest.java index 832729e2df2..a1632877eac 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SpannerOptionsTest.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/SpannerOptionsTest.java @@ -919,7 +919,7 @@ public void testSpannerCallContextTimeoutConfigurator_WithTimeouts() { inputCallContext, CommitRequest.getDefaultInstance(), SpannerGrpc.getCommitMethod()) - .getTimeout()) + .getTimeoutDuration()) .isEqualTo(Duration.ofSeconds(2L)); assertThat( configurator @@ -927,7 +927,7 @@ public void testSpannerCallContextTimeoutConfigurator_WithTimeouts() { inputCallContext, RollbackRequest.getDefaultInstance(), SpannerGrpc.getRollbackMethod()) - .getTimeout()) + .getTimeoutDuration()) .isEqualTo(Duration.ofSeconds(8L)); assertNull( @@ -941,7 +941,7 @@ public void testSpannerCallContextTimeoutConfigurator_WithTimeouts() { inputCallContext, ExecuteSqlRequest.getDefaultInstance(), SpannerGrpc.getExecuteStreamingSqlMethod()) - .getTimeout()) + .getTimeoutDuration()) .isEqualTo(Duration.ofSeconds(3L)); assertThat( configurator @@ -949,7 +949,7 @@ public void testSpannerCallContextTimeoutConfigurator_WithTimeouts() { inputCallContext, ExecuteBatchDmlRequest.getDefaultInstance(), SpannerGrpc.getExecuteBatchDmlMethod()) - .getTimeout()) + .getTimeoutDuration()) .isEqualTo(Duration.ofSeconds(1L)); assertNull( configurator.configure( @@ -960,7 +960,7 @@ public void testSpannerCallContextTimeoutConfigurator_WithTimeouts() { inputCallContext, ReadRequest.getDefaultInstance(), SpannerGrpc.getStreamingReadMethod()) - .getTimeout()) + .getTimeoutDuration()) .isEqualTo(Duration.ofSeconds(7L)); assertThat( @@ -969,7 +969,7 @@ public void testSpannerCallContextTimeoutConfigurator_WithTimeouts() { inputCallContext, PartitionQueryRequest.getDefaultInstance(), SpannerGrpc.getPartitionQueryMethod()) - .getTimeout()) + .getTimeoutDuration()) .isEqualTo(Duration.ofSeconds(5L)); assertThat( configurator @@ -977,7 +977,7 @@ public void testSpannerCallContextTimeoutConfigurator_WithTimeouts() { inputCallContext, PartitionReadRequest.getDefaultInstance(), SpannerGrpc.getPartitionReadMethod()) - .getTimeout()) + .getTimeoutDuration()) .isEqualTo(Duration.ofSeconds(6L)); }