diff --git a/tests/common-pattern.py b/tests/common-pattern.py --- a/tests/common-pattern.py +++ b/tests/common-pattern.py @@ -61,6 +61,14 @@ substitutions = [ # FormatMessage(WSAECONNRESET) br'An existing connection was forcibly closed by the remote host', ), + 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', + ), } for replace, msgs in _errors.items(): diff --git a/tests/test-http-bundle1.t b/tests/test-http-bundle1.t --- a/tests/test-http-bundle1.t +++ b/tests/test-http-bundle1.t @@ -26,15 +26,10 @@ parts that are not bundle1/bundle2 speci Test server address cannot be reused -#if windows $ hg serve -p $HGPORT1 2>&1 - abort: cannot start server at 'localhost:$HGPORT1': * (glob) + abort: cannot start server at 'localhost:$HGPORT1': $EADDRINUSE$ [255] -#else - $ hg serve -p $HGPORT1 2>&1 - abort: cannot start server at 'localhost:$HGPORT1': Address already in use - [255] -#endif + $ cd .. $ cat hg1.pid hg2.pid >> $DAEMON_PIDS diff --git a/tests/test-http.t b/tests/test-http.t --- a/tests/test-http.t +++ b/tests/test-http.t @@ -17,15 +17,10 @@ Test server address cannot be reused -#if windows $ hg serve -p $HGPORT1 2>&1 - abort: cannot start server at 'localhost:$HGPORT1': * (glob) + abort: cannot start server at 'localhost:$HGPORT1': $EADDRINUSE$ [255] -#else - $ hg serve -p $HGPORT1 2>&1 - abort: cannot start server at 'localhost:$HGPORT1': Address already in use - [255] -#endif + $ cd .. $ cat hg1.pid hg2.pid >> $DAEMON_PIDS diff --git a/tests/test-https.t b/tests/test-https.t --- a/tests/test-https.t +++ b/tests/test-https.t @@ -34,15 +34,10 @@ cacert not found Test server address cannot be reused -#if windows $ hg serve -p $HGPORT --certificate=$PRIV 2>&1 - abort: cannot start server at 'localhost:$HGPORT': * (glob) + abort: cannot start server at 'localhost:$HGPORT': $EADDRINUSE$ [255] -#else - $ hg serve -p $HGPORT --certificate=$PRIV 2>&1 - abort: cannot start server at 'localhost:$HGPORT': Address already in use - [255] -#endif + $ cd .. Our test cert is not signed by a trusted CA. It should fail to verify if