On Tue, 12 Jul 2022 07:44:39 GMT, Jaikiran Pai <j...@openjdk.org> wrote:

>> Please find enclosed a simple test fix.
>> This test has been observed failing once with an SSLException. My suspicion 
>> is that some random process (other test or ...) has tried to connect to the 
>> test ReplyingServer and sent some plain text that failed the handshake.
>> 
>> The fix hardens the server to close the connection and proceed to accept the 
>> next one, for a limited number of times...
>
> test/jdk/java/net/httpclient/ResponseBodyBeforeError.java line 349:
> 
>> 347:         @Override
>> 348:         public void run() {
>> 349:             int maxUnexpected = 2;
> 
> Hello Daniel, should we have this `maxUnexpected` at all? Perhaps, we keep 
> accepting and ignoring connections/requests that don't match our 
> expectations? The reason I ask this is, I don't think we will know the exact 
> number of unexpected requests/connections that this server might receive when 
> this test is going on, so with this value of 2, I guess there still would be 
> a chance that this test fails because of those unexpected connections?

This is a good question. I believe this only happens occasionally, and if it 
happens more than once in the same test run then maybe it needs further 
diagnosis. That said - it's possible the rogue client will retry - so maybe we 
should increase the limit? My reasoning was that if the client side of the test 
was changed in the future to cause similar failures we might want the server to 
complain and see the full stack trace.

-------------

PR: https://git.openjdk.org/jdk/pull/9454

Reply via email to