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

Martin von Zweigbergk martinvonz at google.com
Fri Jan 20 15:50:42 EST 2017


On Fri, Jan 20, 2017 at 7:17 AM, Augie Fackler <raf at durin42.com> wrote:
> # HG changeset patch
> # User Augie Fackler <augie at 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 at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


More information about the Mercurial-devel mailing list