Author: markt
Date: Mon Apr 18 11:02:39 2011
New Revision: 1094485
URL: http://svn.apache.org/viewvc?rev=1094485&view=rev
Log:
Stop trying to check for >0ms processing time in access log. There are other
tests that check for correct operation so no need for this.
Hopefully address last remaining Gump failure
Modified:
tomcat/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java
Modified: tomcat/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java?rev=1094485&r1=1094484&r2=1094485&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java
(original)
+++ tomcat/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java Mon
Apr 18 11:02:39 2011
@@ -353,15 +353,6 @@ public class TestAsyncContextImpl extend
final HttpServletResponse resp)
throws ServletException, IOException {
- // Ensure the request takes more than 0 ms to process
- // 0ms processing time in access log usually indicates an error
- try {
- Thread.sleep(1);
- } catch (InterruptedException ie) {
- // Should never happen
- throw new IOException(ie);
- }
-
AsyncContext actxt = req.startAsync();
actxt.setTimeout(3000);
resp.setContentType("text/plain");
@@ -556,15 +547,6 @@ public class TestAsyncContextImpl extend
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
- // Ensure the request takes more than 0 ms to process
- // 0ms processing time in access log usually indicates an error
- try {
- Thread.sleep(1);
- } catch (InterruptedException ie) {
- // Should never happen
- throw new IOException(ie);
- }
-
resp.getWriter().write("DispatchingServletGet-");
resp.flushBuffer();
final int iter = Integer.parseInt(req.getParameter(ITER_PARAM)) -
1;
@@ -1054,9 +1036,9 @@ public class TestAsyncContextImpl extend
int status, long minTime, long maxTime) throws Exception {
List<Entry> entries = alv.getEntries();
- // Assume one entry - wait until it appears (access log entry will be
- // made after response has been returned to user)
- for (int i = 0; i < 10 && entries.size() == 0; i++) {
+ // Wait (but not too long) until all expected entries appear (access
log
+ // entry will be made after response has been returned to user)
+ for (int i = 0; i < 10 && entries.size() < count; i++) {
Thread.sleep(100);
}
@@ -1064,13 +1046,7 @@ public class TestAsyncContextImpl extend
for (int j = 0; j < count; j++) {
Entry entry = entries.get(j);
assertEquals(status, entry.getStatus());
- // A 0ms entry in the access log normally indicates a processing
- // error and we don't expect any of those for 200 responses
- if (minTime == 0 && status == 200) {
- assertTrue(entry.toString(), entry.getTime() > minTime);
- } else {
- assertTrue(entry.toString(), entry.getTime() >= minTime);
- }
+ assertTrue(entry.toString(), entry.getTime() >= minTime);
assertTrue(entry.toString(), entry.getTime() < maxTime);
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]