test: retry on smartos if ECONNREFUSED
authorRich Trott <rtrott@gmail.com>
Fri, 20 Nov 2015 18:15:31 +0000 (10:15 -0800)
committerJames M Snell <jasnell@gmail.com>
Wed, 23 Dec 2015 16:38:33 +0000 (08:38 -0800)
SmartOS has a bug that causes unexpected ECONNREFUSED errors.

See https://smartos.org/bugview/OS-2767

If ECONNREFUSED on SmartOS, retry the test one time.

Fixes: https://github.com/nodejs/node/issues/3864
Fixes: https://github.com/nodejs/node/issues/2815
PR-URL: https://github.com/nodejs/node/pull/3941
Reviewed-By: Fedor Indutny <fedor@indutny.com>
tools/test.py

index 26b70233d53f85e91abafe57119c9ec67f5889cb..49db74727aea382447ec7d3fecfc120ae7084aa8 100755 (executable)
@@ -138,6 +138,13 @@ class ProgressIndicator(object):
       try:
         start = datetime.now()
         output = case.Run()
+        # SmartOS has a bug that causes unexpected ECONNREFUSED errors.
+        # See https://smartos.org/bugview/OS-2767
+        # If ECONNREFUSED on SmartOS, retry the test one time.
+        if (output.UnexpectedOutput() and
+          sys.platform == 'sunos5' and
+          'ECONNREFUSED' in output.output.stderr):
+            output = case.Run()
         case.duration = (datetime.now() - start)
       except IOError, e:
         return