This repository was archived by the owner on Mar 26, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 138
This repository was archived by the owner on Mar 26, 2026. It is now read-only.
Integration tests do not clean up instances under an exception #144
Copy link
Copy link
Closed
Labels
api: spannerIssues related to the googleapis/java-spanner API.Issues related to the googleapis/java-spanner API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
Environment details
spanner/v1.49.2
Steps to reproduce
When the following code has a timeout exception, the created instance will not be cleaned up.
java-spanner/google-cloud-spanner/src/test/java/com/google/cloud/spanner/IntegrationTestEnv.java
Line 124 in ce93f87
| createdInstance = op.get(30000L, TimeUnit.MILLISECONDS); |
I get the following exception:
Caused by: java.util.concurrent.TimeoutException: Waited 30000 milliseconds (plus 129893 nanoseconds delay) for com.google.common.util.concurrent.AbstractCatchingFuture$CatchingFuture@26b95b0b[status=PENDING, info=[inputFuture=[com.google.api.core.ApiFutureToListenableFuture@5f7da3d3], exceptionType=[class java.lang.Exception], fallback=[com.google.api.core.ApiFutures$GaxFunctionToGuavaFunction@103082dd]]]
at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:509)
at com.google.common.util.concurrent.FluentFuture$TrustedFuture.get(FluentFuture.java:102)
at com.google.common.util.concurrent.ForwardingFuture.get(ForwardingFuture.java:68)
at com.google.api.gax.longrunning.OperationFutureImpl.get(OperationFutureImpl.java:133)
at com.google.cloud.spanner.IntegrationTestEnv.initializeInstance(IntegrationTestEnv.java:124)
... 21 moreBut the instance is created successfully but is not deleted. Then, all subsequent tests fail with "Instance already exists" error:
com.google.cloud.spanner.SpannerException: ALREADY_EXISTS: com.google.cloud.spanner.SpannerException: ALREADY_EXISTS: io.grpc.StatusRuntimeException: ALREADY_EXISTS: Instance already exists: projects/test-project/instances/test-instanceExpected behaviour
If a test fails with an exception but an instance is created, the instance should be deleted properly and it should not affect the subsequent tests.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
api: spannerIssues related to the googleapis/java-spanner API.Issues related to the googleapis/java-spanner API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.