ENT-5285, ENT-5296 Ignore ForkJoinPool.commonPool threads in RPCStabilityTests (#6205)

* NOTICK Ignore JUnit time threads in `RPCStabilityTests`

* NOTICK - Ignore ForkJoinPool.commonPool as it's not related to our test

Co-authored-by: LankyDan <danknewton@hotmail.com>
This commit is contained in:
Ryan Fowler 2020-05-11 15:38:23 +01:00 committed by GitHub
parent 6afd443e3a
commit b43e781f27
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -70,7 +70,11 @@ class RPCStabilityTests {
private fun waitUntilNumberOfThreadsStable(executorService: ScheduledExecutorService): Map<Thread, List<StackTraceElement>> {
val values = ConcurrentLinkedQueue<Map<Thread, List<StackTraceElement>>>()
return poll(executorService, "number of threads to become stable", 250.millis) {
values.add(Thread.getAllStackTraces().mapValues { it.value.toList() })
// Exclude threads which we don't use for timing our tests
val map: Map<Thread, List<StackTraceElement>> = Thread.getAllStackTraces()
.filterKeys { !it.name.contains("ForkJoinPool.commonPool") }
.mapValues { it.value.toList() }
values.add(map)
if (values.size > 5) {
values.poll()
}