Patchwork [stable] tests: also allow "Protocol not supported" in test-http-proxy error

login
register
mail settings
Submitter Augie Fackler
Date Jan. 20, 2017, 3:17 p.m.
Message ID <e82b540f38d6eb73c236.1484925471@arthedain.pit.corp.google.com>
Download mbox | patch
Permalink /patch/18269/
State Accepted
Headers show

Comments

Augie Fackler - Jan. 20, 2017, 3:17 p.m.
# HG changeset patch
# User Augie Fackler <augie@google.com>
# Date 1484925454 18000
#      Fri Jan 20 10:17:34 2017 -0500
# Branch stable
# Node ID e82b540f38d6eb73c236a3ee313e263b414a61fa
# Parent  763031a7690db0709bfbf21ad35123d9e03dcd11
tests: also allow "Protocol not supported" in test-http-proxy error

I've seen this in a (misconfigured) FreeBSD jail which has ::1 as an
entry for localhost, but IPv6 support is disabled in the jail. It took
me months to figure out what was going on (and I only figured it out
when tinyproxy.py got confused by similar IPv4-level misconfiguration
of the localhost domain in /etc/hosts.)

I don't feel strongly about this patch: on the one hand, it's papering
over a host-level misconfiguration, but on the other it avoids some
weird and hard to diagnose problems that can occur in weirdly
restricted environments.
Sean Farley - Jan. 20, 2017, 6:27 p.m.
Augie Fackler <raf@durin42.com> writes:

> # HG changeset patch
> # User Augie Fackler <augie@google.com>
> # Date 1484925454 18000
> #      Fri Jan 20 10:17:34 2017 -0500
> # Branch stable
> # Node ID e82b540f38d6eb73c236a3ee313e263b414a61fa
> # Parent  763031a7690db0709bfbf21ad35123d9e03dcd11
> tests: also allow "Protocol not supported" in test-http-proxy error
>
> I've seen this in a (misconfigured) FreeBSD jail which has ::1 as an
> entry for localhost, but IPv6 support is disabled in the jail. It took
> me months to figure out what was going on (and I only figured it out
> when tinyproxy.py got confused by similar IPv4-level misconfiguration
> of the localhost domain in /etc/hosts.)
>
> I don't feel strongly about this patch: on the one hand, it's papering
> over a host-level misconfiguration, but on the other it avoids some
> weird and hard to diagnose problems that can occur in weirdly
> restricted environments.

I would say this is fine but that might just be me.
via Mercurial-devel - Jan. 20, 2017, 8:50 p.m.
On Fri, Jan 20, 2017 at 7:17 AM, Augie Fackler <raf@durin42.com> wrote:
> # HG changeset patch
> # User Augie Fackler <augie@google.com>
> # Date 1484925454 18000
> #      Fri Jan 20 10:17:34 2017 -0500
> # Branch stable
> # Node ID e82b540f38d6eb73c236a3ee313e263b414a61fa
> # Parent  763031a7690db0709bfbf21ad35123d9e03dcd11
> tests: also allow "Protocol not supported" in test-http-proxy error
>
> I've seen this in a (misconfigured) FreeBSD jail which has ::1 as an
> entry for localhost, but IPv6 support is disabled in the jail. It took
> me months to figure out what was going on (and I only figured it out
> when tinyproxy.py got confused by similar IPv4-level misconfiguration
> of the localhost domain in /etc/hosts.)
>
> I don't feel strongly about this patch: on the one hand, it's papering
> over a host-level misconfiguration, but on the other it avoids some
> weird and hard to diagnose problems that can occur in weirdly
> restricted environments.

I agree with the whole paragraph :-)

>
> diff --git a/tests/test-http-proxy.t b/tests/test-http-proxy.t
> --- a/tests/test-http-proxy.t
> +++ b/tests/test-http-proxy.t
> @@ -86,7 +86,7 @@ url with user name and password
>  bad host:port for proxy

The "Protocol not supported" seems surprising, so how about adding a
brief explanation here? I can change it to the following in flight, or
something else if you have a better description.

  bad host:port for proxy ("Protocol not supported" can happen on
misconfigured hosts)

>
>    $ http_proxy=localhost:$HGPORT2 hg clone --config http_proxy.always=True http://localhost:$HGPORT/ f
> -  abort: error: Connection refused
> +  abort: error: (Connection refused|Protocol not supported) (re)
>    [255]
>
>  do not use the proxy if it is in the no list
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Augie Fackler - Jan. 20, 2017, 8:52 p.m.
On Fri, Jan 20, 2017 at 3:50 PM, Martin von Zweigbergk
<martinvonz@google.com> wrote:
>> diff --git a/tests/test-http-proxy.t b/tests/test-http-proxy.t
>> --- a/tests/test-http-proxy.t
>> +++ b/tests/test-http-proxy.t
>> @@ -86,7 +86,7 @@ url with user name and password
>>  bad host:port for proxy
>
> The "Protocol not supported" seems surprising, so how about adding a
> brief explanation here? I can change it to the following in flight, or
> something else if you have a better description.
>
>   bad host:port for proxy ("Protocol not supported" can happen on
> misconfigured hosts)


Your explanation is as good as anything I could contribute. Please
feel encouraged to make that change in-flight.

Thanks!
Augie
via Mercurial-devel - Jan. 20, 2017, 9:03 p.m.
On Fri, Jan 20, 2017 at 12:52 PM, Augie Fackler <raf@durin42.com> wrote:
> On Fri, Jan 20, 2017 at 3:50 PM, Martin von Zweigbergk
> <martinvonz@google.com> wrote:
>>> diff --git a/tests/test-http-proxy.t b/tests/test-http-proxy.t
>>> --- a/tests/test-http-proxy.t
>>> +++ b/tests/test-http-proxy.t
>>> @@ -86,7 +86,7 @@ url with user name and password
>>>  bad host:port for proxy
>>
>> The "Protocol not supported" seems surprising, so how about adding a
>> brief explanation here? I can change it to the following in flight, or
>> something else if you have a better description.
>>
>>   bad host:port for proxy ("Protocol not supported" can happen on
>> misconfigured hosts)
>
>
> Your explanation is as good as anything I could contribute. Please
> feel encouraged to make that change in-flight.

Queued with that change made in flight (but line-wrapped), thanks.

>
> Thanks!
> Augie

Patch

diff --git a/tests/test-http-proxy.t b/tests/test-http-proxy.t
--- a/tests/test-http-proxy.t
+++ b/tests/test-http-proxy.t
@@ -86,7 +86,7 @@  url with user name and password
 bad host:port for proxy
 
   $ http_proxy=localhost:$HGPORT2 hg clone --config http_proxy.always=True http://localhost:$HGPORT/ f
-  abort: error: Connection refused
+  abort: error: (Connection refused|Protocol not supported) (re)
   [255]
 
 do not use the proxy if it is in the no list