divijvaidya opened a new pull request, #13858:
URL: https://github.com/apache/kafka/pull/13858

   ## Problem
   Sometimes we have flaky test failures with a stack trace such as:
   ```
   org.opentest4j.AssertionFailedError: expected: <0> but was: <1>
        at 
app//org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
        at 
app//org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
        at 
app//org.junit.jupiter.api.AssertEquals.failNotEqual(AssertEquals.java:197)
        at 
app//org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:150)
        at 
app//org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:145)
        at 
app//org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:528)
        at 
app//kafka.utils.TestUtils$.assertNoNonDaemonThreads(TestUtils.scala:1347)
        at 
app//kafka.server.ReplicaManagerTest.testDeltaFollowerRemovedTopic(ReplicaManagerTest.scala:3965)
        at 
java.base@11.0.19/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native 
Method)
        at 
java.base@11.0.19/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at 
java.base@11.0.19/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base@11.0.19/java.lang.reflect.Method.invoke(Method.java:566)
   ```
   
   This stack trace tells us that there were unexpected non daemon threads 
running but it doesn't tell us the name of those thread.
   
   ## Solution
   This code change adds the names of the unexpected threads which can help in 
debugging. Note that the names are only printed if the assertion on count fails.


-- 
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

Reply via email to