tests: tolerate differences between Linux and Windows error strings
authorMatt Harbison <matt_harbison@yahoo.com>
Mon, 09 Nov 2015 13:12:35 -0500
changeset 26952 4e566f513fd8
parent 26951 af1ae4ee755c
child 26953 2da6a2dbfc42
tests: tolerate differences between Linux and Windows error strings These are related to differences in how missing files and network connection failures are displayed. I opted to combine the strings in one line instead of using '#if windows' blocks around entire commands in order to avoid future changes being accidentally missed in the Windows sections. Globbing away the entire output seemed wrong, as it could mask other failures. The raw messages involved are: Linux Windows "* not known" <-> "getaddrinfo failed" "Connection refused" <-> "No connection could be made because the target machine actively refused it" "No such file or directory" <-> "The system cannot find the file specified" Issue 4941 indicates that NetBSD has yet another string for "* not known". Also, the histedit test shows that the missing file is printed first on Windows, last on Linux. That is controlled in windows.py:posixfile if we care to change it.
tests/test-clonebundles.t
tests/test-histedit-arguments.t
tests/test-shelve.t
--- a/tests/test-clonebundles.t	Mon Nov 09 12:51:58 2015 -0500
+++ b/tests/test-clonebundles.t	Mon Nov 09 13:12:35 2015 -0500
@@ -84,7 +84,7 @@
   $ echo 'http://does.not.exist/bundle.hg' > server/.hg/clonebundles.manifest
   $ hg clone http://localhost:$HGPORT 404-url
   applying clone bundle from http://does.not.exist/bundle.hg
-  error fetching bundle: * not known (glob)
+  error fetching bundle: (.* not known|getaddrinfo failed) (re)
   abort: error applying bundle
   (if this error persists, consider contacting the server operator or disable clone bundles via "--config experimental.clonebundles=false")
   [255]
@@ -94,7 +94,7 @@
   $ echo "http://localhost:$HGPORT1/bundle.hg" > server/.hg/clonebundles.manifest
   $ hg clone http://localhost:$HGPORT server-not-runner
   applying clone bundle from http://localhost:$HGPORT1/bundle.hg
-  error fetching bundle: Connection refused
+  error fetching bundle: * refused* (glob)
   abort: error applying bundle
   (if this error persists, consider contacting the server operator or disable clone bundles via "--config experimental.clonebundles=false")
   [255]
--- a/tests/test-histedit-arguments.t	Mon Nov 09 12:51:58 2015 -0500
+++ b/tests/test-histedit-arguments.t	Mon Nov 09 13:12:35 2015 -0500
@@ -339,7 +339,7 @@
   $ mv ../corrupt-histedit .hg/histedit-state
   $ hg histedit --abort
   warning: encountered an exception during histedit --abort; the repository may not have been completely cleaned up
-  abort: No such file or directory: * (glob)
+  abort: .*(No such file or directory:|The system cannot find the file specified).* (re)
   [255]
 Histedit state has been exited
   $ hg summary -q
--- a/tests/test-shelve.t	Mon Nov 09 12:51:58 2015 -0500
+++ b/tests/test-shelve.t	Mon Nov 09 13:12:35 2015 -0500
@@ -1158,7 +1158,7 @@
   $ rm .hg/unshelverebasestate
   $ hg unshelve --abort
   unshelve of 'default' aborted
-  abort: No such file or directory
+  abort: (No such file or directory|The system cannot find the file specified) (re)
   [255]
 Can the user leave the current state?
   $ hg up -C .