Skip to content

Lingering threads in multiple tests #7319

Open
@aoli-al

Description

@aoli-al

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

  • I agree to follow the code of conduct.

  • I can reproduce the bug with the latest version of Guava available.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions