tests: update network related errors for Debian 9
authorBoris Feld <boris.feld@octobus.net>
Mon, 10 Dec 2018 10:21:08 +0100
changeset 53647 8695fbe17f7cbe5187b72b48f01984ce8cada594
parent 53646 7cda0cacbbf653c58a60b77828526122836b5ad7
child 53648 bcf70058af90cffa5f231ea0e4ed5c6835e07672
push id1079
push usergszorc@mozilla.com
push dateMon, 10 Dec 2018 19:44:59 +0000
tests: update network related errors for Debian 9 We have a CI job that runs the Mercurial tests in parallel. Some of the network related failures seems to be different on the environment. Oddly, those failures happens only when running the tests in parallel, not when running the test file only. I have no idea how to get the windows formatted message for the error, if someone could give me an hand, I will update this changeset with the value. Differential Revision: https://phab.mercurial-scm.org/D5401
tests/common-pattern.py
tests/test-http-bad-server.t
tests/test-http-proxy.t
tests/test-lfs-serve-access.t
--- a/tests/common-pattern.py
+++ b/tests/common-pattern.py
@@ -138,16 +138,22 @@ substitutions = [
     br'$EADDRINUSE$': (
         # strerror()
         br'Address already in use',
 
         # FormatMessage(WSAEADDRINUSE)
         br'Only one usage of each socket address'
         br' \(protocol/network address/port\) is normally permitted',
     ),
+    br'$EADDRNOTAVAIL$': (
+        # strerror()
+        br'Cannot assign requested address',
+
+        # FormatMessage(WSAEADDRNOTAVAIL)
+    )
 }
 
 for replace, msgs in _errors.items():
     substitutions.extend((m, replace) for m in msgs)
 
 # Output lines on Windows that can be autocorrected for '\' vs '/' path
 # differences.
 _winpathfixes = [
--- a/tests/test-http-bad-server.t
+++ b/tests/test-http-bad-server.t
@@ -31,17 +31,18 @@ and because debugging partial responses 
   > EOF
 
 Failure to accept() socket should result in connection related error message
 
   $ hg serve --config badserver.closebeforeaccept=true -p $HGPORT -d --pid-file=hg.pid
   $ cat hg.pid > $DAEMON_PIDS
 
   $ hg clone http://localhost:$HGPORT/ clone
-  abort: error: $ECONNRESET$
+  abort: error: $ECONNRESET$ (?)
+  abort: error: $EADDRNOTAVAIL$ (?)
   [255]
 
 (The server exits on its own, but there is a race between that and starting a new server.
 So ensure the process is dead.)
 
   $ killdaemons.py $DAEMON_PIDS
 
 Failure immediately after accept() should yield connection related error message
--- a/tests/test-http-proxy.t
+++ b/tests/test-http-proxy.t
@@ -85,17 +85,18 @@ url with user name and password
   new changesets 83180e7845de
   updating to branch default
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
 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|Protocol not supported|.* actively refused it|Cannot assign requested address) (re)
+  abort: error: (Connection refused|Protocol not supported|.* actively refused it) (re) (?)
+  abort: error: $EADDRNOTAVAIL$ (?)
   [255]
 
 do not use the proxy if it is in the no list
 
   $ http_proxy=localhost:$HGPORT1 hg clone --config http_proxy.no=localhost http://localhost:$HGPORT/ g
   requesting all changes
   adding changesets
   adding manifests
--- a/tests/test-lfs-serve-access.t
+++ b/tests/test-lfs-serve-access.t
@@ -77,17 +77,18 @@ Downloads fail...
 Reasonable hint for a misconfigured blob server
 
   $ hg -R httpclone update default --config lfs.url=http://localhost:$HGPORT/missing
   abort: LFS HTTP error: HTTP Error 404: Not Found!
   (the "lfs.url" config may be used to override http://localhost:$HGPORT/missing)
   [255]
 
   $ hg -R httpclone update default --config lfs.url=http://localhost:$HGPORT2/missing
-  abort: LFS error: *onnection *refused*! (glob)
+  abort: LFS error: *onnection *refused*! (glob) (?)
+  abort: LFS error: $EADDRNOTAVAIL$! (glob) (?)
   (the "lfs.url" config may be used to override http://localhost:$HGPORT2/missing)
   [255]
 
 Blob URIs are correct when --prefix is used
 
   $ hg clone --debug http://localhost:$HGPORT/subdir/mount/point cloned2
   using http://localhost:$HGPORT/subdir/mount/point
   sending capabilities command