Merged
Changes from 1 commit
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Failed to load files.
PrevPrevious commit
Next Next commit
fix: fix retry condition test
  • Loading branch information
@olavloite
olavloite committedApr 10, 2020
commit 1e9c4a6de7c268b3dd5b6b59e384e826d4605994
Original file line numberDiff line numberDiff line change
Expand Up@@ -22,7 +22,6 @@
import com.google.api.gax.grpc.GrpcInterceptorProvider;
import com.google.api.gax.longrunning.OperationFuture;
import com.google.api.gax.paging.Page;
import com.google.api.gax.rpc.FailedPreconditionException;
import com.google.cloud.Timestamp;
import com.google.cloud.spanner.Backup;
import com.google.cloud.spanner.Database;
Expand All@@ -32,6 +31,7 @@
import com.google.cloud.spanner.Options;
import com.google.cloud.spanner.ParallelIntegrationTest;
import com.google.cloud.spanner.Spanner;
import com.google.cloud.spanner.SpannerException;
import com.google.cloud.spanner.SpannerOptions;
import com.google.cloud.spanner.testing.RemoteSpannerHelper;
import com.google.common.collect.ImmutableList;
Expand DownExpand Up@@ -341,13 +341,13 @@ public void testRetryNonIdempotentRpcsReturningLongRunningOperations() throws Ex
restoredDbId);
databases.add(op.get());
// Assert that the RestoreDatabase RPC was called only once, and that the operation
// tracking
// was resumed through a GetOperation call.
// tracking was resumed through a GetOperation call.
assertThat(createDbInterceptor.methodCount.get()).isEqualTo(1);
assertThat(createDbInterceptor.getOperationCount.get()).isAtLeast(1);
break;
} catch (ExecutionException e) {
if (e.getCause() instanceof FailedPreconditionException
if (e.getCause() instanceof SpannerException
&& ((SpannerException) e.getCause()).getErrorCode() == ErrorCode.FAILED_PRECONDITION
&& e.getCause()
.getMessage()
.contains("Please retry the operation once the pending restores complete")) {
Expand Down