Flaky tests in the RPCStabilityTests suite

Description

Test client and server dont leak threads is failing rather frequently lately, e.g.: https://ci01.dev.r3.com/blue/organizations/jenkins/Corda%20Org%20External%20Pull%20Requests%2Fcorda/detail/PR-6140/5/tests

blocking people from merging their PR with unrelated changes.

Attempts been made to fix it: but then the changes were reverted.
Error
java.lang.IllegalArgumentException: Threads have leaked. New threads created: [Thread[ForkJoinPool.commonPool-worker-0,5,FailOnTimeoutGroup]] (total before: 20, total after: 21)
Stacktrace
java.lang.IllegalArgumentException: Threads have leaked. New threads created: [Thread[ForkJoinPool.commonPool-worker-0,5,FailOnTimeoutGroup]] (total before: 20, total after: 21)
at net.corda.client.rpc.RPCStabilityTests.runBlockAndCheckThreads(RPCStabilityTests.kt:110)
at net.corda.client.rpc.RPCStabilityTests.client and server dont leak threads(RPCStabilityTests.kt:95)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:298)
at org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:292)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.lang.Thread.run(Thread.java:748)

Assignee

Unassigned

Reporter

Viktor Kolomeyko

Labels

Sprint

None

Epic Link

None

Priority

Medium

Engineering Teams

None

Fix versions

None

Affects versions

None

Ported to...

None

Story Points / Dev Days

None

Build cut

None

Feature Team

Select team
Configure