Testing RC of Tomcat 7.0.105 I observe occasional failures with org.apache.tomcat.websocket.pojo.TestEncodingDecoding test. I do not consider this a showstopper. The following test fails: [[[ Testcase: testAnnotatedEndPoints took 5,185 sec FAILED null junit.framework.AssertionFailedError at org.apache.tomcat.websocket.pojo.TestEncodingDecoding.testEvent(TestEncodingDecoding.java:230) at org.apache.tomcat.websocket.pojo.TestEncodingDecoding.testAnnotatedEndPoints(TestEncodingDecoding.java:164) ]]] or [[[ Testcase: testAnnotatedEndPoints took 5,181 sec FAILED null junit.framework.AssertionFailedError at org.apache.tomcat.websocket.pojo.TestEncodingDecoding.testEvent(TestEncodingDecoding.java:230) at org.apache.tomcat.websocket.pojo.TestEncodingDecoding.testAnnotatedEndPoints(TestEncodingDecoding.java:162) ]]] 1. Note the line number difference: TestEncodingDecoding.testAnnotatedEndPoints(TestEncodingDecoding.java:164) TestEncodingDecoding.testAnnotatedEndPoints(TestEncodingDecoding.java:162) "testEvent()" is a helper method, and the line number in testAnnotatedEndPoints shows the actual event being tested: [[[ 161 // Should not take very long but some failures have been seen 162 i = testEvent(MsgStringEncoder.class.getName()+":init", 0); 163 i = testEvent(MsgStringDecoder.class.getName()+":init", i); 164 i = testEvent(MsgByteEncoder.class.getName()+":init", i); 165 i = testEvent(MsgByteDecoder.class.getName()+":init", i); ]]] 2. The failures are not reliable. I observed the failures with AdoptOpenJDK 8u252 (jdk-8.0.252.09-hotspot) 64-bit and AdoptOpenJDK 11.0.7 (jdk-11.0.7.10-hotspot) on Windows 10 1909. Out of (1 + 1 + 10) * 3 connectors = 36 runs there are 6 failures, with different connectors (BIO/NIO/APR). I guess that a connector does not matter. 3. The test could be improved to provide some better diagnostics, instead of failing on the first error and with no message (null).
Created attachment 37352 [details] TEST-org.apache.tomcat.websocket.pojo.TestEncodingDecoding.APR.txt A log from testing with Java 8 (AdoptOpenJDK jdk-8.0.252.09-hotspot)
Created attachment 37353 [details] TEST-org.apache.tomcat.websocket.pojo.TestEncodingDecoding.NIO.txt A log from testing with Java 11 (AdoptOpenJDK jdk-11.0.7.10-hotspot)
Searching other mentions of the test class in Bugzilla, it looks that those checks in the test were added when fixing bug 55127.
I see some potential concurrency issues in that test class but I am having trouble reproducing the issue. I've only managed once out of ~50 runs so far. If I address the issues I see, can you re-test?
OK. Done. Please re-test assuming you are able to.
Created attachment 37354 [details] TEST-org.apache.tomcat.websocket.pojo.TestEncodingDecoding.BIO.txt (7.0.x at 90f95ab8, Java 11) Testing current 7.0.x (at 90f95ab83874dba5a7062fc0bc8803aecaba1937), thus far I have 1 failure out of {(20 runs with Java 8 + 20 runs with Java 11) x 3 connectors}. I am attaching the log file for the failed test. The test was with Java 11, BIO connector. Its a different test method that was failing, so this is really a different issue. The failure: [[[ Testcase: testMessagesEndPoints took 0,08 sec FAILED expected:<2> but was:<1> junit.framework.AssertionFailedError: expected:<2> but was:<1> at org.apache.tomcat.websocket.pojo.TestEncodingDecoding.testMessagesEndPoints(TestEncodingDecoding.java:267) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ]]]
That looks a lot better. That new failure is in one of the disabled tests that I enabled. Let me see if I missed something when I reviewed the test.
Yep. I missed the additional client message. I've updated the test code. It should pass now.
Testing current 7.0.x (at 4ac8e86347a6a82133354312e7eb8c1aa09bb129): I had {(30 runs with Java 8, 60 runs with Java 11, 30 runs with Java 14) x all 3 connectors - on Windows 10}. No issues noted - Testing this test class completes successfully. Thus I marking this issue as RESOLVED.