Guava Version
514f212
Description
While running Guava tests, I noticed multiple threads created by different tests that were left open.
Here is the incomplete list:
The thread pool was opened here, but the shutdown was not called.
|
ExecutorService threadPool = Executors.newFixedThreadPool(nThreads); |
In FuturesTest.java, multiple tests call newSingleThreadExecutor() without shutdown.
|
ListenableFuture<String> futureResult = |
In TestThread.java, calling stop() may throw UnsupportedOperationException for the new version of Java. Thus, the join method will not be called. (maybe call interrupt when stop is not available?)
Example
Any test mentioned above.
Expected Behavior
The test should clean up threads.
Actual Behavior
Threads left open.
Packages
No response
Platforms
No response
Checklist
Guava Version
514f212
Description
While running Guava tests, I noticed multiple threads created by different tests that were left open.
Here is the incomplete list:
The thread pool was opened here, but the shutdown was not called.
guava/guava-tests/test/com/google/common/cache/CacheBuilderTest.java
Line 496 in 514f212
In FuturesTest.java, multiple tests call
newSingleThreadExecutor()without shutdown.guava/guava-tests/test/com/google/common/util/concurrent/FuturesTest.java
Line 444 in 514f212
In TestThread.java, calling
stop()may throwUnsupportedOperationExceptionfor the new version of Java. Thus, thejoinmethod will not be called. (maybe call interrupt when stop is not available?)guava/guava-tests/test/com/google/common/util/concurrent/TestThread.java
Line 76 in 514f212
Example
Expected Behavior
The test should clean up threads.
Actual Behavior
Threads left open.
Packages
No response
Platforms
No response
Checklist
I agree to follow the code of conduct.
I can reproduce the bug with the latest version of Guava available.