You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by rj...@apache.org on 2013/02/03 11:33:06 UTC

svn commit: r1441885 - in /tomcat/native/branches/1.1.x: ./ TODO.txt test/org/apache/tomcat/jni/SocketServerTestSuite.java

Author: rjung
Date: Sun Feb  3 10:33:06 2013
New Revision: 1441885

URL: http://svn.apache.org/viewvc?rev=1441885&view=rev
Log:
Widen accepted timeout return time in SocketServerTestSuite.

Backport of r1441884 from tcnative trunk.

Modified:
    tomcat/native/branches/1.1.x/   (props changed)
    tomcat/native/branches/1.1.x/TODO.txt
    tomcat/native/branches/1.1.x/test/org/apache/tomcat/jni/SocketServerTestSuite.java

Propchange: tomcat/native/branches/1.1.x/
------------------------------------------------------------------------------
  Merged /tomcat/native/trunk:r1441884

Modified: tomcat/native/branches/1.1.x/TODO.txt
URL: http://svn.apache.org/viewvc/tomcat/native/branches/1.1.x/TODO.txt?rev=1441885&r1=1441884&r2=1441885&view=diff
==============================================================================
--- tomcat/native/branches/1.1.x/TODO.txt (original)
+++ tomcat/native/branches/1.1.x/TODO.txt Sun Feb  3 10:33:06 2013
@@ -41,10 +41,6 @@ Java Tests and Examples
 - No mentioning of running "ant download" before tests. Without
   it test compilation fails.
 
-- "ant test" fails in line 85 of SocketServerTestSuite.java, because
-  on my system the checking for precisely 2 milliseconds won't work.
-  The call returns after 11 millis not after 2
-
 - "ant run-echo": will fail, because by default uses privileged
   port 23. Maybe switch to 8023 as a default?
   Users should not run tests as root and on most systems the default

Modified: tomcat/native/branches/1.1.x/test/org/apache/tomcat/jni/SocketServerTestSuite.java
URL: http://svn.apache.org/viewvc/tomcat/native/branches/1.1.x/test/org/apache/tomcat/jni/SocketServerTestSuite.java?rev=1441885&r1=1441884&r2=1441885&view=diff
==============================================================================
--- tomcat/native/branches/1.1.x/test/org/apache/tomcat/jni/SocketServerTestSuite.java (original)
+++ tomcat/native/branches/1.1.x/test/org/apache/tomcat/jni/SocketServerTestSuite.java Sun Feb  3 10:33:06 2013
@@ -79,7 +79,8 @@ public class SocketServerTestSuite exten
         while (Socket.recv(clientSock, buf, 0, 1) == 1) {
         }
         long wait = System.currentTimeMillis() - start;
-        if (wait < 1 || wait >3) {
+        /* allow some margin between set timeout and observed return time */
+        if (wait < 1 || wait > 12) {
             Socket.close(clientSock);
             Socket.close(serverSock);
             throw new Exception("2 milliseconds client Socket.timeoutSet failed");
@@ -101,7 +102,8 @@ public class SocketServerTestSuite exten
             ok = true;
         }
         wait = System.currentTimeMillis() - start;
-        if (wait < 1 || wait >3 && ! ok) {
+        /* allow some margin between set timeout and observed return time */
+        if (wait < 1 || wait > 12 && ! ok) {
             Socket.close(clientSock);
             Socket.close(serverSock);
             throw new Exception("2 milliseconds accept Socket.timeoutSet failed");



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