You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Martin Grigorov <mg...@apache.org> on 2021/10/20 11:53:34 UTC

2 tests in TestCoyoteAdapterCanonicalization fail

Hi,

Today I've tested JDK 17.0.1 and noticed these failures:

Testcase: testCanonicalizationSpecification[49:
requestURI[/foo%E2%82%ACbar]] took 0.055 sec
        FAILED
HTTP/1.1 200
/foo€bar
junit.framework.AssertionFailedError: HTTP/1.1 200
/foo€bar
        at
org.apache.catalina.connector.TestCoyoteAdapterCanonicalization.doTestCanonicalization(TestCoyoteAdapterCanonicalization.java:200)
        at
org.apache.catalina.connector.TestCoyoteAdapterCanonicalization.testCanonicalizationSpecification(TestCoyoteAdapterCanonicalization.java:156)
        at jdk.internal.reflect.GeneratedMethodAccessor28.invoke(Unknown
Source)
        at
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

Testcase: testCanonicalizationTomcat[49: requestURI[/foo%E2%82%ACbar]] took
0.087 sec
        FAILED
HTTP/1.1 200
/foo€bar
junit.framework.AssertionFailedError: HTTP/1.1 200
/foo€bar
        at
org.apache.catalina.connector.TestCoyoteAdapterCanonicalization.doTestCanonicalization(TestCoyoteAdapterCanonicalization.java:200)
        at
org.apache.catalina.connector.TestCoyoteAdapterCanonicalization.testCanonicalizationTomcat(TestCoyoteAdapterCanonicalization.java:161)
        at jdk.internal.reflect.GeneratedMethodAccessor29.invoke(Unknown
Source)
        at
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

They fail consitently on both x86_64 and aarch64.

Regards,
Martin

Re: 2 tests in TestCoyoteAdapterCanonicalization fail

Posted by Martin Grigorov <mg...@apache.org>.
On Thu, Oct 21, 2021, 19:30 Christopher Schultz <
chris@christopherschultz.net> wrote:

> Martin,
>
> On 10/21/21 06:09, Martin Grigorov wrote:
> > On Thu, Oct 21, 2021 at 12:29 PM Mark Thomas <ma...@apache.org> wrote:
> >
> >> On 21/10/2021 10:19, Mark Thomas wrote:
> >>> On 21/10/2021 08:40, Martin Grigorov wrote:
> >>>
> >>> <snip/>
> >>>
> >>>>> Fails also at TravisCI:
> >>>>> https://app.travis-ci.com/github/apache/tomcat/jobs/543217112
> >>>>>
> >>>>
> >>>> diff --git
> >>>>
> >>
> test/org/apache/catalina/connector/TestCoyoteAdapterCanonicalization.java
> >>>>
> >>
> test/org/apache/catalina/connector/TestCoyoteAdapterCanonicalization.java
> >>>> index 710e0c7..37c13ef 100644
> >>>> ---
> >>>>
> >>
> test/org/apache/catalina/connector/TestCoyoteAdapterCanonicalization.java
> >>>> +++
> >>>>
> >>
> test/org/apache/catalina/connector/TestCoyoteAdapterCanonicalization.java
> >>>> @@ -185,7 +185,7 @@ public class TestCoyoteAdapterCanonicalization
> >>>> extends
> >>>> TomcatBaseTest {
> >>>>                    "Host: localhost" + CRLF +
> >>>>                    CRLF
> >>>>            });
> >>>> -        client.setResponseBodyEncoding(StandardCharsets.UTF_8);
> >>>> +    //    client.setResponseBodyEncoding(StandardCharsets.UTF_8);
> >>>>
> >>>> This fixes the problem here.
> >>>
> >>> That suggests the server isn't sending the correct bytes. I think the
> >>> above change is addressing a symptom rather than the root cause.
> >>>
> >>> We need to dig into this some more.
> >>
> >> Fixed it. It was the source file encoding.
> >>
> >
> > It works now but I don't quite understand the issue yet.
> > Both Intellij IDEA and vim say that
> TestCoyoteAdapterCanonicalization.java
> > file is/was UTF-8.
> > Which source file exactly is ISO_8859_1 ?
>
> The Java /compiler/ says "source files are ISO-8859-1". We specify it
> explicitly in build.xml in the <javac> invocation.
>

Ant!
Got it!
Thanks!


> So you can't put high-ASCII or things like € in there safely.
>
> Sure, you can change the compiler encoding if you want, but since it's
> been this way for a long time, it's easier to change the single character.
>
> -chris
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>
>

Re: 2 tests in TestCoyoteAdapterCanonicalization fail

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Martin,

On 10/21/21 06:09, Martin Grigorov wrote:
> On Thu, Oct 21, 2021 at 12:29 PM Mark Thomas <ma...@apache.org> wrote:
> 
>> On 21/10/2021 10:19, Mark Thomas wrote:
>>> On 21/10/2021 08:40, Martin Grigorov wrote:
>>>
>>> <snip/>
>>>
>>>>> Fails also at TravisCI:
>>>>> https://app.travis-ci.com/github/apache/tomcat/jobs/543217112
>>>>>
>>>>
>>>> diff --git
>>>>
>> test/org/apache/catalina/connector/TestCoyoteAdapterCanonicalization.java
>>>>
>> test/org/apache/catalina/connector/TestCoyoteAdapterCanonicalization.java
>>>> index 710e0c7..37c13ef 100644
>>>> ---
>>>>
>> test/org/apache/catalina/connector/TestCoyoteAdapterCanonicalization.java
>>>> +++
>>>>
>> test/org/apache/catalina/connector/TestCoyoteAdapterCanonicalization.java
>>>> @@ -185,7 +185,7 @@ public class TestCoyoteAdapterCanonicalization
>>>> extends
>>>> TomcatBaseTest {
>>>>                    "Host: localhost" + CRLF +
>>>>                    CRLF
>>>>            });
>>>> -        client.setResponseBodyEncoding(StandardCharsets.UTF_8);
>>>> +    //    client.setResponseBodyEncoding(StandardCharsets.UTF_8);
>>>>
>>>> This fixes the problem here.
>>>
>>> That suggests the server isn't sending the correct bytes. I think the
>>> above change is addressing a symptom rather than the root cause.
>>>
>>> We need to dig into this some more.
>>
>> Fixed it. It was the source file encoding.
>>
> 
> It works now but I don't quite understand the issue yet.
> Both Intellij IDEA and vim say that TestCoyoteAdapterCanonicalization.java
> file is/was UTF-8.
> Which source file exactly is ISO_8859_1 ?

The Java /compiler/ says "source files are ISO-8859-1". We specify it 
explicitly in build.xml in the <javac> invocation.

So you can't put high-ASCII or things like € in there safely.

Sure, you can change the compiler encoding if you want, but since it's 
been this way for a long time, it's easier to change the single character.

-chris

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


Re: 2 tests in TestCoyoteAdapterCanonicalization fail

Posted by Mark Thomas <ma...@homeinbox.net>.
On October 21, 2021 10:09:09 AM UTC, Martin Grigorov <mg...@apache.org> wrote:
>On Thu, Oct 21, 2021 at 12:29 PM Mark Thomas <ma...@apache.org> wrote:
>
>> On 21/10/2021 10:19, Mark Thomas wrote:
>> > On 21/10/2021 08:40, Martin Grigorov wrote:
>> >
>> > <snip/>
>> >
>> >>> Fails also at TravisCI:
>> >>> https://app.travis-ci.com/github/apache/tomcat/jobs/543217112
>> >>>
>> >>
>> >> diff --git
>> >>
>>
>test/org/apache/catalina/connector/TestCoyoteAdapterCanonicalization.java
>> >>
>>
>test/org/apache/catalina/connector/TestCoyoteAdapterCanonicalization.java
>> >> index 710e0c7..37c13ef 100644
>> >> ---
>> >>
>>
>test/org/apache/catalina/connector/TestCoyoteAdapterCanonicalization.java
>> >> +++
>> >>
>>
>test/org/apache/catalina/connector/TestCoyoteAdapterCanonicalization.java
>> >> @@ -185,7 +185,7 @@ public class TestCoyoteAdapterCanonicalization
>> >> extends
>> >> TomcatBaseTest {
>> >>                   "Host: localhost" + CRLF +
>> >>                   CRLF
>> >>           });
>> >> -        client.setResponseBodyEncoding(StandardCharsets.UTF_8);
>> >> +    //    client.setResponseBodyEncoding(StandardCharsets.UTF_8);
>> >>
>> >> This fixes the problem here.
>> >
>> > That suggests the server isn't sending the correct bytes. I think
>the
>> > above change is addressing a symptom rather than the root cause.
>> >
>> > We need to dig into this some more.
>>
>> Fixed it. It was the source file encoding.
>>
>
>It works now but I don't quite understand the issue yet.
>Both Intellij IDEA and vim say that
>TestCoyoteAdapterCanonicalization.java
>file is/was UTF-8.
>Which source file exactly is ISO_8859_1 ?

The Ant build.xml file is configured to treat all source files as ISO-8859-1.

Mark

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


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


Re: 2 tests in TestCoyoteAdapterCanonicalization fail

Posted by Martin Grigorov <mg...@apache.org>.
On Thu, Oct 21, 2021 at 12:29 PM Mark Thomas <ma...@apache.org> wrote:

> On 21/10/2021 10:19, Mark Thomas wrote:
> > On 21/10/2021 08:40, Martin Grigorov wrote:
> >
> > <snip/>
> >
> >>> Fails also at TravisCI:
> >>> https://app.travis-ci.com/github/apache/tomcat/jobs/543217112
> >>>
> >>
> >> diff --git
> >>
> test/org/apache/catalina/connector/TestCoyoteAdapterCanonicalization.java
> >>
> test/org/apache/catalina/connector/TestCoyoteAdapterCanonicalization.java
> >> index 710e0c7..37c13ef 100644
> >> ---
> >>
> test/org/apache/catalina/connector/TestCoyoteAdapterCanonicalization.java
> >> +++
> >>
> test/org/apache/catalina/connector/TestCoyoteAdapterCanonicalization.java
> >> @@ -185,7 +185,7 @@ public class TestCoyoteAdapterCanonicalization
> >> extends
> >> TomcatBaseTest {
> >>                   "Host: localhost" + CRLF +
> >>                   CRLF
> >>           });
> >> -        client.setResponseBodyEncoding(StandardCharsets.UTF_8);
> >> +    //    client.setResponseBodyEncoding(StandardCharsets.UTF_8);
> >>
> >> This fixes the problem here.
> >
> > That suggests the server isn't sending the correct bytes. I think the
> > above change is addressing a symptom rather than the root cause.
> >
> > We need to dig into this some more.
>
> Fixed it. It was the source file encoding.
>

It works now but I don't quite understand the issue yet.
Both Intellij IDEA and vim say that TestCoyoteAdapterCanonicalization.java
file is/was UTF-8.
Which source file exactly is ISO_8859_1 ?


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

Re: 2 tests in TestCoyoteAdapterCanonicalization fail

Posted by Mark Thomas <ma...@apache.org>.
On 21/10/2021 10:19, Mark Thomas wrote:
> On 21/10/2021 08:40, Martin Grigorov wrote:
> 
> <snip/>
> 
>>> Fails also at TravisCI:
>>> https://app.travis-ci.com/github/apache/tomcat/jobs/543217112
>>>
>>
>> diff --git
>> test/org/apache/catalina/connector/TestCoyoteAdapterCanonicalization.java
>> test/org/apache/catalina/connector/TestCoyoteAdapterCanonicalization.java
>> index 710e0c7..37c13ef 100644
>> ---
>> test/org/apache/catalina/connector/TestCoyoteAdapterCanonicalization.java
>> +++
>> test/org/apache/catalina/connector/TestCoyoteAdapterCanonicalization.java
>> @@ -185,7 +185,7 @@ public class TestCoyoteAdapterCanonicalization 
>> extends
>> TomcatBaseTest {
>>                   "Host: localhost" + CRLF +
>>                   CRLF
>>           });
>> -        client.setResponseBodyEncoding(StandardCharsets.UTF_8);
>> +    //    client.setResponseBodyEncoding(StandardCharsets.UTF_8);
>>
>> This fixes the problem here.
> 
> That suggests the server isn't sending the correct bytes. I think the 
> above change is addressing a symptom rather than the root cause.
> 
> We need to dig into this some more.

Fixed it. It was the source file encoding.

Mark

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


Re: 2 tests in TestCoyoteAdapterCanonicalization fail

Posted by Mark Thomas <ma...@apache.org>.
On 21/10/2021 08:40, Martin Grigorov wrote:

<snip/>

>> Fails also at TravisCI:
>> https://app.travis-ci.com/github/apache/tomcat/jobs/543217112
>>
> 
> diff --git
> test/org/apache/catalina/connector/TestCoyoteAdapterCanonicalization.java
> test/org/apache/catalina/connector/TestCoyoteAdapterCanonicalization.java
> index 710e0c7..37c13ef 100644
> ---
> test/org/apache/catalina/connector/TestCoyoteAdapterCanonicalization.java
> +++
> test/org/apache/catalina/connector/TestCoyoteAdapterCanonicalization.java
> @@ -185,7 +185,7 @@ public class TestCoyoteAdapterCanonicalization extends
> TomcatBaseTest {
>                   "Host: localhost" + CRLF +
>                   CRLF
>           });
> -        client.setResponseBodyEncoding(StandardCharsets.UTF_8);
> +    //    client.setResponseBodyEncoding(StandardCharsets.UTF_8);
> 
> This fixes the problem here.

That suggests the server isn't sending the correct bytes. I think the 
above change is addressing a symptom rather than the root cause.

We need to dig into this some more.

Mark

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


Re: 2 tests in TestCoyoteAdapterCanonicalization fail

Posted by Martin Grigorov <mg...@apache.org>.
On Thu, Oct 21, 2021 at 10:29 AM Martin Grigorov <mg...@apache.org>
wrote:

>
>
> On Thu, Oct 21, 2021 at 10:13 AM Martin Grigorov <mg...@apache.org>
> wrote:
>
>>
>>
>> On Thu, Oct 21, 2021 at 9:56 AM Martin Grigorov <mg...@apache.org>
>> wrote:
>>
>>>
>>>
>>> On Wed, Oct 20, 2021 at 3:39 PM Mark Thomas <ma...@apache.org> wrote:
>>>
>>>> I'm not seeing those failures with OpenJDK 17.0.1
>>>>
>>>
>>> I see the test is added 8 days ago, so most probably it is not related
>>> to the JDK version at all.
>>>
>>>
>>>>
>>>> The response line and body look to be correct to me.
>>>>
>>>> The failure appears to be with the request body. Is it possible you
>>>> aren't using UTF-8 for the *.java file? You could try using
>>>>
>>>
>>> I just clone the Git repo. It should use the encoding of the file.
>>>
>>>
>>>> "/foo\u20acbar" as the expected canonicalized URI.
>>>>
>>>
>>> I will test it now!
>>> First, I will replace assertTrue with assertEquals at
>>> https://github.com/apache/tomcat/commit/fee1f457f287a56d3d490a5ab5b3f643d280ecf5#diff-fae30dfd485f718b7b7d76763204c70a1d7257d319018763b98366d3f446decbR200
>>>
>>
>> HTTP/1.1 200
>> /foo€bar expected:</foo[€]bar> but was:</foo[â<U+0082>¬]bar>
>> junit.framework.AssertionFailedError: HTTP/1.1 200
>> /foo€bar expected:</foo[€]bar> but was:</foo[â<U+0082>¬]bar>
>>         at
>> org.apache.catalina.connector.TestCoyoteAdapterCanonicalization.doTestCanonicalization(TestCoyoteAdapterCanonicalization.java:200)
>>         at
>> org.apache.catalina.connector.TestCoyoteAdapterCanonicalization.testCanonicalizationSpecification(TestCoyoteAdapterCanonicalization.java:156)
>>         at jdk.internal.reflect.GeneratedMethodAccessor28.invoke(Unknown
>> Source)
>>         at
>> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>
>> Testcase: testCanonicalizationTomcat[49: requestURI[/foo%E2%82%ACbar]]
>> took 0.011 sec
>>         FAILED
>> HTTP/1.1 200
>> /foo€bar expected:</foo[€]bar> but was:</foo[â<U+0082>¬]bar>
>> junit.framework.AssertionFailedError: HTTP/1.1 200
>> /foo€bar expected:</foo[€]bar> but was:</foo[â<U+0082>¬]bar>
>>         at
>> org.apache.catalina.connector.TestCoyoteAdapterCanonicalization.doTestCanonicalization(TestCoyoteAdapterCanonicalization.java:200)
>>         at
>> org.apache.catalina.connector.TestCoyoteAdapterCanonicalization.testCanonicalizationTomcat(TestCoyoteAdapterCanonicalization.java:161)
>>         at jdk.internal.reflect.GeneratedMethodAccessor29.invoke(Unknown
>> Source)
>>         at
>> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>
>>
>>>
>>>
>>>>
>>>> Mark
>>>>
>>>>
>>>> On 20/10/2021 12:53, Martin Grigorov wrote:
>>>> > Hi,
>>>> >
>>>> > Today I've tested JDK 17.0.1 and noticed these failures:
>>>> >
>>>> > Testcase: testCanonicalizationSpecification[49:
>>>> > requestURI[/foo%E2%82%ACbar]] took 0.055 sec
>>>> >          FAILED
>>>> > HTTP/1.1 200
>>>> > /foo€bar
>>>> > junit.framework.AssertionFailedError: HTTP/1.1 200
>>>> > /foo€bar
>>>> >          at
>>>> >
>>>> org.apache.catalina.connector.TestCoyoteAdapterCanonicalization.doTestCanonicalization(TestCoyoteAdapterCanonicalization.java:200)
>>>> >          at
>>>> >
>>>> org.apache.catalina.connector.TestCoyoteAdapterCanonicalization.testCanonicalizationSpecification(TestCoyoteAdapterCanonicalization.java:156)
>>>> >          at
>>>> jdk.internal.reflect.GeneratedMethodAccessor28.invoke(Unknown
>>>> > Source)
>>>> >          at
>>>> >
>>>> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>>> >
>>>> > Testcase: testCanonicalizationTomcat[49:
>>>> requestURI[/foo%E2%82%ACbar]] took
>>>> > 0.087 sec
>>>> >          FAILED
>>>> > HTTP/1.1 200
>>>> > /foo€bar
>>>> > junit.framework.AssertionFailedError: HTTP/1.1 200
>>>> > /foo€bar
>>>> >          at
>>>> >
>>>> org.apache.catalina.connector.TestCoyoteAdapterCanonicalization.doTestCanonicalization(TestCoyoteAdapterCanonicalization.java:200)
>>>> >          at
>>>> >
>>>> org.apache.catalina.connector.TestCoyoteAdapterCanonicalization.testCanonicalizationTomcat(TestCoyoteAdapterCanonicalization.java:161)
>>>> >          at
>>>> jdk.internal.reflect.GeneratedMethodAccessor29.invoke(Unknown
>>>> > Source)
>>>> >          at
>>>> >
>>>> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>>> >
>>>> > They fail consitently on both x86_64 and aarch64.
>>>>
>>>
> Fails also at TravisCI:
> https://app.travis-ci.com/github/apache/tomcat/jobs/543217112
>

diff --git
test/org/apache/catalina/connector/TestCoyoteAdapterCanonicalization.java
test/org/apache/catalina/connector/TestCoyoteAdapterCanonicalization.java
index 710e0c7..37c13ef 100644
---
test/org/apache/catalina/connector/TestCoyoteAdapterCanonicalization.java
+++
test/org/apache/catalina/connector/TestCoyoteAdapterCanonicalization.java
@@ -185,7 +185,7 @@ public class TestCoyoteAdapterCanonicalization extends
TomcatBaseTest {
                 "Host: localhost" + CRLF +
                 CRLF
         });
-        client.setResponseBodyEncoding(StandardCharsets.UTF_8);
+    //    client.setResponseBodyEncoding(StandardCharsets.UTF_8);

This fixes the problem here.


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

Re: 2 tests in TestCoyoteAdapterCanonicalization fail

Posted by Martin Grigorov <mg...@apache.org>.
On Thu, Oct 21, 2021 at 10:13 AM Martin Grigorov <mg...@apache.org>
wrote:

>
>
> On Thu, Oct 21, 2021 at 9:56 AM Martin Grigorov <mg...@apache.org>
> wrote:
>
>>
>>
>> On Wed, Oct 20, 2021 at 3:39 PM Mark Thomas <ma...@apache.org> wrote:
>>
>>> I'm not seeing those failures with OpenJDK 17.0.1
>>>
>>
>> I see the test is added 8 days ago, so most probably it is not related to
>> the JDK version at all.
>>
>>
>>>
>>> The response line and body look to be correct to me.
>>>
>>> The failure appears to be with the request body. Is it possible you
>>> aren't using UTF-8 for the *.java file? You could try using
>>>
>>
>> I just clone the Git repo. It should use the encoding of the file.
>>
>>
>>> "/foo\u20acbar" as the expected canonicalized URI.
>>>
>>
>> I will test it now!
>> First, I will replace assertTrue with assertEquals at
>> https://github.com/apache/tomcat/commit/fee1f457f287a56d3d490a5ab5b3f643d280ecf5#diff-fae30dfd485f718b7b7d76763204c70a1d7257d319018763b98366d3f446decbR200
>>
>
> HTTP/1.1 200
> /foo€bar expected:</foo[€]bar> but was:</foo[â<U+0082>¬]bar>
> junit.framework.AssertionFailedError: HTTP/1.1 200
> /foo€bar expected:</foo[€]bar> but was:</foo[â<U+0082>¬]bar>
>         at
> org.apache.catalina.connector.TestCoyoteAdapterCanonicalization.doTestCanonicalization(TestCoyoteAdapterCanonicalization.java:200)
>         at
> org.apache.catalina.connector.TestCoyoteAdapterCanonicalization.testCanonicalizationSpecification(TestCoyoteAdapterCanonicalization.java:156)
>         at jdk.internal.reflect.GeneratedMethodAccessor28.invoke(Unknown
> Source)
>         at
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>
> Testcase: testCanonicalizationTomcat[49: requestURI[/foo%E2%82%ACbar]]
> took 0.011 sec
>         FAILED
> HTTP/1.1 200
> /foo€bar expected:</foo[€]bar> but was:</foo[â<U+0082>¬]bar>
> junit.framework.AssertionFailedError: HTTP/1.1 200
> /foo€bar expected:</foo[€]bar> but was:</foo[â<U+0082>¬]bar>
>         at
> org.apache.catalina.connector.TestCoyoteAdapterCanonicalization.doTestCanonicalization(TestCoyoteAdapterCanonicalization.java:200)
>         at
> org.apache.catalina.connector.TestCoyoteAdapterCanonicalization.testCanonicalizationTomcat(TestCoyoteAdapterCanonicalization.java:161)
>         at jdk.internal.reflect.GeneratedMethodAccessor29.invoke(Unknown
> Source)
>         at
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>
>
>>
>>
>>>
>>> Mark
>>>
>>>
>>> On 20/10/2021 12:53, Martin Grigorov wrote:
>>> > Hi,
>>> >
>>> > Today I've tested JDK 17.0.1 and noticed these failures:
>>> >
>>> > Testcase: testCanonicalizationSpecification[49:
>>> > requestURI[/foo%E2%82%ACbar]] took 0.055 sec
>>> >          FAILED
>>> > HTTP/1.1 200
>>> > /foo€bar
>>> > junit.framework.AssertionFailedError: HTTP/1.1 200
>>> > /foo€bar
>>> >          at
>>> >
>>> org.apache.catalina.connector.TestCoyoteAdapterCanonicalization.doTestCanonicalization(TestCoyoteAdapterCanonicalization.java:200)
>>> >          at
>>> >
>>> org.apache.catalina.connector.TestCoyoteAdapterCanonicalization.testCanonicalizationSpecification(TestCoyoteAdapterCanonicalization.java:156)
>>> >          at
>>> jdk.internal.reflect.GeneratedMethodAccessor28.invoke(Unknown
>>> > Source)
>>> >          at
>>> >
>>> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>> >
>>> > Testcase: testCanonicalizationTomcat[49: requestURI[/foo%E2%82%ACbar]]
>>> took
>>> > 0.087 sec
>>> >          FAILED
>>> > HTTP/1.1 200
>>> > /foo€bar
>>> > junit.framework.AssertionFailedError: HTTP/1.1 200
>>> > /foo€bar
>>> >          at
>>> >
>>> org.apache.catalina.connector.TestCoyoteAdapterCanonicalization.doTestCanonicalization(TestCoyoteAdapterCanonicalization.java:200)
>>> >          at
>>> >
>>> org.apache.catalina.connector.TestCoyoteAdapterCanonicalization.testCanonicalizationTomcat(TestCoyoteAdapterCanonicalization.java:161)
>>> >          at
>>> jdk.internal.reflect.GeneratedMethodAccessor29.invoke(Unknown
>>> > Source)
>>> >          at
>>> >
>>> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>> >
>>> > They fail consitently on both x86_64 and aarch64.
>>>
>>
Fails also at TravisCI:
https://app.travis-ci.com/github/apache/tomcat/jobs/543217112


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

Re: 2 tests in TestCoyoteAdapterCanonicalization fail

Posted by Martin Grigorov <mg...@apache.org>.
On Thu, Oct 21, 2021 at 9:56 AM Martin Grigorov <mg...@apache.org>
wrote:

>
>
> On Wed, Oct 20, 2021 at 3:39 PM Mark Thomas <ma...@apache.org> wrote:
>
>> I'm not seeing those failures with OpenJDK 17.0.1
>>
>
> I see the test is added 8 days ago, so most probably it is not related to
> the JDK version at all.
>
>
>>
>> The response line and body look to be correct to me.
>>
>> The failure appears to be with the request body. Is it possible you
>> aren't using UTF-8 for the *.java file? You could try using
>>
>
> I just clone the Git repo. It should use the encoding of the file.
>
>
>> "/foo\u20acbar" as the expected canonicalized URI.
>>
>
> I will test it now!
> First, I will replace assertTrue with assertEquals at
> https://github.com/apache/tomcat/commit/fee1f457f287a56d3d490a5ab5b3f643d280ecf5#diff-fae30dfd485f718b7b7d76763204c70a1d7257d319018763b98366d3f446decbR200
>

HTTP/1.1 200
/foo€bar expected:</foo[€]bar> but was:</foo[â<U+0082>¬]bar>
junit.framework.AssertionFailedError: HTTP/1.1 200
/foo€bar expected:</foo[€]bar> but was:</foo[â<U+0082>¬]bar>
        at
org.apache.catalina.connector.TestCoyoteAdapterCanonicalization.doTestCanonicalization(TestCoyoteAdapterCanonicalization.java:200)
        at
org.apache.catalina.connector.TestCoyoteAdapterCanonicalization.testCanonicalizationSpecification(TestCoyoteAdapterCanonicalization.java:156)
        at jdk.internal.reflect.GeneratedMethodAccessor28.invoke(Unknown
Source)
        at
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

Testcase: testCanonicalizationTomcat[49: requestURI[/foo%E2%82%ACbar]] took
0.011 sec
        FAILED
HTTP/1.1 200
/foo€bar expected:</foo[€]bar> but was:</foo[â<U+0082>¬]bar>
junit.framework.AssertionFailedError: HTTP/1.1 200
/foo€bar expected:</foo[€]bar> but was:</foo[â<U+0082>¬]bar>
        at
org.apache.catalina.connector.TestCoyoteAdapterCanonicalization.doTestCanonicalization(TestCoyoteAdapterCanonicalization.java:200)
        at
org.apache.catalina.connector.TestCoyoteAdapterCanonicalization.testCanonicalizationTomcat(TestCoyoteAdapterCanonicalization.java:161)
        at jdk.internal.reflect.GeneratedMethodAccessor29.invoke(Unknown
Source)
        at
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)


>
>
>>
>> Mark
>>
>>
>> On 20/10/2021 12:53, Martin Grigorov wrote:
>> > Hi,
>> >
>> > Today I've tested JDK 17.0.1 and noticed these failures:
>> >
>> > Testcase: testCanonicalizationSpecification[49:
>> > requestURI[/foo%E2%82%ACbar]] took 0.055 sec
>> >          FAILED
>> > HTTP/1.1 200
>> > /foo€bar
>> > junit.framework.AssertionFailedError: HTTP/1.1 200
>> > /foo€bar
>> >          at
>> >
>> org.apache.catalina.connector.TestCoyoteAdapterCanonicalization.doTestCanonicalization(TestCoyoteAdapterCanonicalization.java:200)
>> >          at
>> >
>> org.apache.catalina.connector.TestCoyoteAdapterCanonicalization.testCanonicalizationSpecification(TestCoyoteAdapterCanonicalization.java:156)
>> >          at
>> jdk.internal.reflect.GeneratedMethodAccessor28.invoke(Unknown
>> > Source)
>> >          at
>> >
>> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>> >
>> > Testcase: testCanonicalizationTomcat[49: requestURI[/foo%E2%82%ACbar]]
>> took
>> > 0.087 sec
>> >          FAILED
>> > HTTP/1.1 200
>> > /foo€bar
>> > junit.framework.AssertionFailedError: HTTP/1.1 200
>> > /foo€bar
>> >          at
>> >
>> org.apache.catalina.connector.TestCoyoteAdapterCanonicalization.doTestCanonicalization(TestCoyoteAdapterCanonicalization.java:200)
>> >          at
>> >
>> org.apache.catalina.connector.TestCoyoteAdapterCanonicalization.testCanonicalizationTomcat(TestCoyoteAdapterCanonicalization.java:161)
>> >          at
>> jdk.internal.reflect.GeneratedMethodAccessor29.invoke(Unknown
>> > Source)
>> >          at
>> >
>> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>> >
>> > They fail consitently on both x86_64 and aarch64.
>> >
>> > Regards,
>> > Martin
>> >
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: dev-help@tomcat.apache.org
>>
>>

Re: 2 tests in TestCoyoteAdapterCanonicalization fail

Posted by Martin Grigorov <mg...@apache.org>.
On Wed, Oct 20, 2021 at 3:39 PM Mark Thomas <ma...@apache.org> wrote:

> I'm not seeing those failures with OpenJDK 17.0.1
>

I see the test is added 8 days ago, so most probably it is not related to
the JDK version at all.


>
> The response line and body look to be correct to me.
>
> The failure appears to be with the request body. Is it possible you
> aren't using UTF-8 for the *.java file? You could try using
>

I just clone the Git repo. It should use the encoding of the file.


> "/foo\u20acbar" as the expected canonicalized URI.
>

I will test it now!
First, I will replace assertTrue with assertEquals at
https://github.com/apache/tomcat/commit/fee1f457f287a56d3d490a5ab5b3f643d280ecf5#diff-fae30dfd485f718b7b7d76763204c70a1d7257d319018763b98366d3f446decbR200


>
> Mark
>
>
> On 20/10/2021 12:53, Martin Grigorov wrote:
> > Hi,
> >
> > Today I've tested JDK 17.0.1 and noticed these failures:
> >
> > Testcase: testCanonicalizationSpecification[49:
> > requestURI[/foo%E2%82%ACbar]] took 0.055 sec
> >          FAILED
> > HTTP/1.1 200
> > /foo€bar
> > junit.framework.AssertionFailedError: HTTP/1.1 200
> > /foo€bar
> >          at
> >
> org.apache.catalina.connector.TestCoyoteAdapterCanonicalization.doTestCanonicalization(TestCoyoteAdapterCanonicalization.java:200)
> >          at
> >
> org.apache.catalina.connector.TestCoyoteAdapterCanonicalization.testCanonicalizationSpecification(TestCoyoteAdapterCanonicalization.java:156)
> >          at jdk.internal.reflect.GeneratedMethodAccessor28.invoke(Unknown
> > Source)
> >          at
> >
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> >
> > Testcase: testCanonicalizationTomcat[49: requestURI[/foo%E2%82%ACbar]]
> took
> > 0.087 sec
> >          FAILED
> > HTTP/1.1 200
> > /foo€bar
> > junit.framework.AssertionFailedError: HTTP/1.1 200
> > /foo€bar
> >          at
> >
> org.apache.catalina.connector.TestCoyoteAdapterCanonicalization.doTestCanonicalization(TestCoyoteAdapterCanonicalization.java:200)
> >          at
> >
> org.apache.catalina.connector.TestCoyoteAdapterCanonicalization.testCanonicalizationTomcat(TestCoyoteAdapterCanonicalization.java:161)
> >          at jdk.internal.reflect.GeneratedMethodAccessor29.invoke(Unknown
> > Source)
> >          at
> >
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> >
> > They fail consitently on both x86_64 and aarch64.
> >
> > Regards,
> > Martin
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>
>

Re: 2 tests in TestCoyoteAdapterCanonicalization fail

Posted by Mark Thomas <ma...@apache.org>.
I'm not seeing those failures with OpenJDK 17.0.1

The response line and body look to be correct to me.

The failure appears to be with the request body. Is it possible you 
aren't using UTF-8 for the *.java file? You could try using 
"/foo\u20acbar" as the expected canonicalized URI.

Mark


On 20/10/2021 12:53, Martin Grigorov wrote:
> Hi,
> 
> Today I've tested JDK 17.0.1 and noticed these failures:
> 
> Testcase: testCanonicalizationSpecification[49:
> requestURI[/foo%E2%82%ACbar]] took 0.055 sec
>          FAILED
> HTTP/1.1 200
> /foo€bar
> junit.framework.AssertionFailedError: HTTP/1.1 200
> /foo€bar
>          at
> org.apache.catalina.connector.TestCoyoteAdapterCanonicalization.doTestCanonicalization(TestCoyoteAdapterCanonicalization.java:200)
>          at
> org.apache.catalina.connector.TestCoyoteAdapterCanonicalization.testCanonicalizationSpecification(TestCoyoteAdapterCanonicalization.java:156)
>          at jdk.internal.reflect.GeneratedMethodAccessor28.invoke(Unknown
> Source)
>          at
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 
> Testcase: testCanonicalizationTomcat[49: requestURI[/foo%E2%82%ACbar]] took
> 0.087 sec
>          FAILED
> HTTP/1.1 200
> /foo€bar
> junit.framework.AssertionFailedError: HTTP/1.1 200
> /foo€bar
>          at
> org.apache.catalina.connector.TestCoyoteAdapterCanonicalization.doTestCanonicalization(TestCoyoteAdapterCanonicalization.java:200)
>          at
> org.apache.catalina.connector.TestCoyoteAdapterCanonicalization.testCanonicalizationTomcat(TestCoyoteAdapterCanonicalization.java:161)
>          at jdk.internal.reflect.GeneratedMethodAccessor29.invoke(Unknown
> Source)
>          at
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 
> They fail consitently on both x86_64 and aarch64.
> 
> Regards,
> Martin
> 


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