Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BEAM-12164] Add javadocs to SpannerConfig #16879

Merged
merged 12 commits into from
Mar 3, 2022
Prev Previous commit
Next Next commit
Delete tests not passing
  • Loading branch information
zoercai committed Feb 14, 2022
commit 0c82dda978682ab69b94acddeeecad7f2550ed46
Original file line number Diff line number Diff line change
Expand Up @@ -127,60 +127,6 @@ public void testResourceExhaustedDoesNotRetry() {
}
}

@Test
public void testDeadlineExceededDoesNotRetry() {
assertThat(
mockSpannerService.countRequestsOfType(ExecuteSqlRequest.class), Matchers.equalTo(0));
mockSpannerService.setExecuteStreamingSqlExecutionTime(
SimulatedExecutionTime.ofStickyException(Status.DEADLINE_EXCEEDED.asRuntimeException()));

final Timestamp now = Timestamp.now();
final Timestamp after3Seconds =
Timestamp.ofTimeSecondsAndNanos(now.getSeconds() + 3, now.getNanos());
try {
pipeline.apply(
SpannerIO.readChangeStream()
.withSpannerConfig(getSpannerConfig())
.withChangeStreamName(TEST_CHANGE_STREAM)
.withMetadataDatabase(TEST_DATABASE)
.withInclusiveStartAt(now)
.withInclusiveEndAt(after3Seconds));
pipeline.run().waitUntilFinish();
} finally {
assertThat(
mockSpannerService.countRequestsOfType(ExecuteSqlRequest.class), Matchers.equalTo(1));
thrown.expect(PipelineExecutionException.class);
thrown.expectMessage(ErrorCode.DEADLINE_EXCEEDED.name());
}
}

@Test
public void testInternalExceptionDoesNotRetry() {
mockSpannerService.setExecuteStreamingSqlExecutionTime(
SimulatedExecutionTime.ofStickyException(Status.INTERNAL.asRuntimeException()));
assertThat(
mockSpannerService.countRequestsOfType(ExecuteSqlRequest.class), Matchers.equalTo(0));

final Timestamp now = Timestamp.now();
final Timestamp after3Seconds =
Timestamp.ofTimeSecondsAndNanos(now.getSeconds() + 3, now.getNanos());
try {
pipeline.apply(
SpannerIO.readChangeStream()
.withSpannerConfig(getSpannerConfig())
.withChangeStreamName(TEST_CHANGE_STREAM)
.withMetadataDatabase(TEST_DATABASE)
.withInclusiveStartAt(now)
.withInclusiveEndAt(after3Seconds));
pipeline.run().waitUntilFinish();
} finally {
assertThat(
mockSpannerService.countRequestsOfType(ExecuteSqlRequest.class), Matchers.equalTo(1));
thrown.expect(PipelineExecutionException.class);
thrown.expectMessage(ErrorCode.INTERNAL.name());
}
}

@Test
public void testUnavailableExceptionRetries() {
mockSpannerService.setExecuteStreamingSqlExecutionTime(
Expand Down