Skip to content

Commit

Permalink
fix units
Browse files Browse the repository at this point in the history
  • Loading branch information
diegomarquezp committed Nov 21, 2024
1 parent 439e105 commit fafe22a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,6 @@ public void testBatchCreateSessionsTimesOut_whenResourceExhausted() throws Excep
List<ListenableFuture<Void>> futures = new ArrayList<>(5000);
AtomicInteger counter = new AtomicInteger();
for (int i = 0; i < 5000; i++) {
final int index = i;
futures.add(
service.submit(
() -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -919,15 +919,15 @@ public void testSpannerCallContextTimeoutConfigurator_WithTimeouts() {
inputCallContext,
CommitRequest.getDefaultInstance(),
SpannerGrpc.getCommitMethod())
.getTimeout())
.getTimeoutDuration())
.isEqualTo(Duration.ofSeconds(2L));
assertThat(
configurator
.configure(
inputCallContext,
RollbackRequest.getDefaultInstance(),
SpannerGrpc.getRollbackMethod())
.getTimeout())
.getTimeoutDuration())
.isEqualTo(Duration.ofSeconds(8L));

assertNull(
Expand All @@ -941,15 +941,15 @@ public void testSpannerCallContextTimeoutConfigurator_WithTimeouts() {
inputCallContext,
ExecuteSqlRequest.getDefaultInstance(),
SpannerGrpc.getExecuteStreamingSqlMethod())
.getTimeout())
.getTimeoutDuration())
.isEqualTo(Duration.ofSeconds(3L));
assertThat(
configurator
.configure(
inputCallContext,
ExecuteBatchDmlRequest.getDefaultInstance(),
SpannerGrpc.getExecuteBatchDmlMethod())
.getTimeout())
.getTimeoutDuration())
.isEqualTo(Duration.ofSeconds(1L));
assertNull(
configurator.configure(
Expand All @@ -960,7 +960,7 @@ public void testSpannerCallContextTimeoutConfigurator_WithTimeouts() {
inputCallContext,
ReadRequest.getDefaultInstance(),
SpannerGrpc.getStreamingReadMethod())
.getTimeout())
.getTimeoutDuration())
.isEqualTo(Duration.ofSeconds(7L));

assertThat(
Expand All @@ -969,15 +969,15 @@ public void testSpannerCallContextTimeoutConfigurator_WithTimeouts() {
inputCallContext,
PartitionQueryRequest.getDefaultInstance(),
SpannerGrpc.getPartitionQueryMethod())
.getTimeout())
.getTimeoutDuration())
.isEqualTo(Duration.ofSeconds(5L));
assertThat(
configurator
.configure(
inputCallContext,
PartitionReadRequest.getDefaultInstance(),
SpannerGrpc.getPartitionReadMethod())
.getTimeout())
.getTimeoutDuration())
.isEqualTo(Duration.ofSeconds(6L));
}

Expand Down

0 comments on commit fafe22a

Please sign in to comment.