NOTICK Ignore JUnit time threads in RPCStabilityTests (#6201)

This commit is contained in:
Dan Newton 2020-04-30 10:50:54 +01:00 committed by GitHub
parent cb84fd86ee
commit ecf74053c0
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 from JUnits timeout group which we use for timing out tests
val map: Map<Thread, List<StackTraceElement>> = Thread.getAllStackTraces()
.filterKeys { it.threadGroup.name != "FailOnTimeoutGroup" }
.mapValues { it.value.toList() }
values.add(map)
if (values.size > 5) {
values.poll()
}