chia7712 commented on code in PR #16499: URL: https://github.com/apache/kafka/pull/16499#discussion_r1676520831
########## core/src/test/java/kafka/test/junit/ClusterTestExtensions.java: ########## @@ -119,7 +131,30 @@ public Stream<TestTemplateInvocationContext> provideTestTemplateInvocationContex return generatedContexts.stream(); } + @Override + @SuppressWarnings("booleanexpressioncomplexity") + public void beforeEach(ExtensionContext context) { + detectThreadLeak = DetectThreadLeak.of(thread -> { + String name = thread.getName(); + return !name.startsWith(METRICS_METER_TICK_THREAD_PREFIX) && Review Comment: Could we have a `Set` to collect those prefix and then use lambda to impl the filter? for example: ```java private static final Set<String> SKIPPED_THREAD_PREFIX = Collections.unmodifiableSet(Stream.of("metrics-meter-tick-thread", "scala-") .collect(Collectors.toSet())); detectThreadLeak = DetectThreadLeak.of(thread -> SKIPPED_THREAD_PREFIX.stream().noneMatch(prefix -> thread.getName().startsWith(prefix))); ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org