On 23/10/2014 23:26, Konstantin Kolinko wrote:
> 2014-10-24 1:36 GMT+04:00 Christopher Schultz <ch...@christopherschultz.net>:
>> Mark,
>>
>> On 10/23/14 3:48 PM, ma...@apache.org wrote:
>>> Author: markt
>>> Date: Thu Oct 23 19:48:08 2014
>>> New Revision: 1633936
>>>
>>> URL: http://svn.apache.org/r1633936
>>> Log:
>>> Fix some intermittent test failures with NIO2 on OSX (problems with the 
>>> test, not the code)
>>>
>>> Modified:
>>>     tomcat/trunk/test/org/apache/catalina/connector/TestCoyoteAdapter.java
>>>
>>> Modified: 
>>> tomcat/trunk/test/org/apache/catalina/connector/TestCoyoteAdapter.java
>>> URL: 
>>> http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/connector/TestCoyoteAdapter.java?rev=1633936&r1=1633935&r2=1633936&view=diff
>>> ==============================================================================
>>> --- tomcat/trunk/test/org/apache/catalina/connector/TestCoyoteAdapter.java 
>>> (original)
>>> +++ tomcat/trunk/test/org/apache/catalina/connector/TestCoyoteAdapter.java 
>>> Thu Oct 23 19:48:08 2014
>>> @@ -360,7 +360,13 @@ public class TestCoyoteAdapter extends T
>>>                  public void run() {
>>>                      for (int i = 0; i < 20; i++) {
>>>                          try {
>>> -                            os.write(BYTES_8K);
>>> +                            // Some tests depend on this write failing 
>>> (e.g.
>>> +                            // because the client has gone away). In some 
>>> cases
>>> +                            // there may be a large (ish) buffer to fill 
>>> before
>>> +                            // the write fails.
>>> +                            for (int j = 0 ; j < 8; i++) {
>>> +                                os.write(BYTES_8K);
>>> +                            }
>>
>> I'm fairly sure you want j++ here instead of i++, otherwise your tests
>> are going to take a very long time to complete.
>>
> 
> Agreed.
> 
> Luckily this code is used by one test only (testBug54928()) and in
> that test the client goes away. That makes os.write() to fail with an
> IOException, avoiding an infinite loop.

+1.

Thanks for fixing.

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to