diff tests/test-http-proxy.t @ 51942:73a43fe3e6fd

tests: use pattern matching to mask `ECONNREFUSED` messages The second and third one of these in `test-http-proxy.t` was failing on Windows. The others were found by grep and by failed tests when output was matched and an attempt was made to emit the mask pattern. The first clonebundles failure on Windows emitted: error fetching bundle: [WinError 10061] $ECONNREFUSED$ We should probably stringify that better to get rid of the "[WinError 10061]" part.
author Matt Harbison <matt_harbison@yahoo.com>
date Tue, 01 Oct 2024 21:34:44 -0400
parents dcaa2df1f688
children
line wrap: on
line diff
--- a/tests/test-http-proxy.t	Sat Oct 05 17:32:26 2024 -0400
+++ b/tests/test-http-proxy.t	Tue Oct 01 21:34:44 2024 -0400
@@ -81,7 +81,7 @@
 misconfigured hosts)
 
   $ http_proxy=localhost:$HGPORT2 hg clone --config http_proxy.always=True http://localhost:$HGPORT/ f
-  abort: error: (Connection refused|Protocol not supported|.* actively refused it|\$EADDRNOTAVAIL\$|No route to host) (re)
+  abort: error: (\$ECONNREFUSED\$|Protocol not supported|.* actively refused it|\$EADDRNOTAVAIL\$|No route to host) (re)
   [100]
 
 do not use the proxy if it is in the no list
@@ -99,7 +99,7 @@
 proxy can't connect to server
 
   $ http_proxy=http://localhost:$HGPORT1/ hg --config http_proxy.always=True clone http://localhost:$HGPORT2/ h
-  abort: HTTP Error 404: Connection refused
+  abort: HTTP Error 404: $ECONNREFUSED$
   [100]
 
   $ cat proxy.log
@@ -118,5 +118,5 @@
   * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob)
   $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=batch HTTP/1.1" - - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
   $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
-  * - - [*] code 404, message Connection refused (glob)
+  * - - [*] code 404, message $ECONNREFUSED$ (glob)
   $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT2/?cmd=capabilities HTTP/1.1" 404 - (glob)