This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/9.0.x by this push:
     new 4a869d8  Add debug logging to regularly failing test
4a869d8 is described below

commit 4a869d87e8496cf55f3c058937d51fabe5da6cd3
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Thu Aug 27 21:22:15 2020 +0100

    Add debug logging to regularly failing test
---
 .../apache/coyote/http2/TestHttp2Section_6_1.java  | 59 +++++++++++++---------
 1 file changed, 34 insertions(+), 25 deletions(-)

diff --git a/test/org/apache/coyote/http2/TestHttp2Section_6_1.java 
b/test/org/apache/coyote/http2/TestHttp2Section_6_1.java
index 0027982..20405d4 100644
--- a/test/org/apache/coyote/http2/TestHttp2Section_6_1.java
+++ b/test/org/apache/coyote/http2/TestHttp2Section_6_1.java
@@ -16,6 +16,9 @@
  */
 package org.apache.coyote.http2;
 
+import java.util.logging.Level;
+import java.util.logging.LogManager;
+
 import org.junit.Assert;
 import org.junit.Test;
 
@@ -49,31 +52,37 @@ public class TestHttp2Section_6_1 extends Http2TestBase {
 
     @Test
     public void testDataFrameWithPadding() throws Exception {
-        http2Connect();
-
-        byte[] padding = new byte[8];
-
-        sendSimplePostRequest(3, padding);
-        readSimplePostResponse(true);
-
-
-        // The window update for the padding could occur anywhere since it
-        // happens on a different thead to the response.
-        String trace = output.getTrace();
-        String paddingWindowUpdate = "0-WindowSize-[9]\n3-WindowSize-[9]\n";
-
-        Assert.assertTrue(trace, trace.contains(paddingWindowUpdate));
-        trace = trace.replace(paddingWindowUpdate, "");
-
-        Assert.assertEquals("0-WindowSize-[119]\n" +
-                "3-WindowSize-[119]\n" +
-                "3-HeadersStart\n" +
-                "3-Header-[:status]-[200]\n" +
-                "3-Header-[content-length]-[119]\n" +
-                "3-Header-[date]-[Wed, 11 Nov 2015 19:18:42 GMT]\n" +
-                "3-HeadersEnd\n" +
-                "3-Body-119\n" +
-                "3-EndOfStream\n", trace);
+        
LogManager.getLogManager().getLogger("org.apache.coyote").setLevel(Level.ALL);
+        
LogManager.getLogManager().getLogger("org.apache.tomcat.util.net").setLevel(Level.ALL);
+        try {
+            http2Connect();
+
+            byte[] padding = new byte[8];
+
+            sendSimplePostRequest(3, padding);
+            readSimplePostResponse(true);
+
+            // The window update for the padding could occur anywhere since it
+            // happens on a different thead to the response.
+            String trace = output.getTrace();
+            String paddingWindowUpdate = 
"0-WindowSize-[9]\n3-WindowSize-[9]\n";
+
+            Assert.assertTrue(trace, trace.contains(paddingWindowUpdate));
+            trace = trace.replace(paddingWindowUpdate, "");
+
+            Assert.assertEquals("0-WindowSize-[119]\n" +
+                    "3-WindowSize-[119]\n" +
+                    "3-HeadersStart\n" +
+                    "3-Header-[:status]-[200]\n" +
+                    "3-Header-[content-length]-[119]\n" +
+                    "3-Header-[date]-[Wed, 11 Nov 2015 19:18:42 GMT]\n" +
+                    "3-HeadersEnd\n" +
+                    "3-Body-119\n" +
+                    "3-EndOfStream\n", trace);
+        } finally {
+            
LogManager.getLogManager().getLogger("org.apache.coyote").setLevel(Level.INFO);
+            
LogManager.getLogManager().getLogger("org.apache.tomcat.util.net").setLevel(Level.INFO);
+        }
     }
 
 


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

Reply via email to