Skip to content

Commit cd10082

Browse files
committed
fixing broken test - cloud/spanner/SessionPoolIntegrationTest.java
1 parent 540734e commit cd10082

1 file changed

Lines changed: 2 additions & 14 deletions

File tree

google-cloud-spanner/src/test/java/com/google/cloud/spanner/SessionPoolIntegrationTest.java

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,12 @@
1919
import static com.google.common.truth.Truth.assertThat;
2020

2121
import com.google.cloud.grpc.GrpcTransportOptions.ExecutorFactory;
22-
import com.google.common.util.concurrent.ListenableFuture;
2322
import java.util.ArrayList;
2423
import java.util.List;
2524
import java.util.concurrent.CountDownLatch;
2625
import java.util.concurrent.ScheduledExecutorService;
2726
import java.util.concurrent.ScheduledThreadPoolExecutor;
2827
import java.util.concurrent.TimeUnit;
29-
import java.util.concurrent.TimeoutException;
30-
import junit.framework.Assert;
3128
import org.junit.Before;
3229
import org.junit.BeforeClass;
3330
import org.junit.ClassRule;
@@ -173,17 +170,8 @@ public void closeAfterInitialCreateDoesNotBlockIndefinitely() throws Exception {
173170
}
174171

175172
@Test
176-
public void closeWhenSessionsActiveDoesNotBlockIndefinitely() throws Exception {
173+
public void closeWhenSessionsActiveFinishes() throws Exception {
177174
Session session = pool.getReadSession();
178-
ListenableFuture<Void> future = pool.closeAsync();
179-
try {
180-
future.get(5, TimeUnit.SECONDS);
181-
Assert.fail("Closure future should not have finished");
182-
} catch (TimeoutException e) {
183-
// expected
184-
}
185-
session.close();
186-
// Now pool should close.
187-
future.get();
175+
pool.closeAsync().get();
188176
}
189177
}

0 commit comments

Comments
 (0)