File tree Expand file tree Collapse file tree
google-cloud-spanner/src/test/java/com/google/cloud/spanner Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1919import static com .google .common .truth .Truth .assertThat ;
2020
2121import com .google .cloud .grpc .GrpcTransportOptions .ExecutorFactory ;
22- import com .google .common .util .concurrent .ListenableFuture ;
2322import java .util .ArrayList ;
2423import java .util .List ;
2524import java .util .concurrent .CountDownLatch ;
2625import java .util .concurrent .ScheduledExecutorService ;
2726import java .util .concurrent .ScheduledThreadPoolExecutor ;
2827import java .util .concurrent .TimeUnit ;
29- import java .util .concurrent .TimeoutException ;
30- import junit .framework .Assert ;
3128import org .junit .Before ;
3229import org .junit .BeforeClass ;
3330import 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}
You can’t perform that action at this time.
0 commit comments