run-tests: don't mask errors when a server fails to start
authorMatt Harbison <matt_harbison@yahoo.com>
Sun, 25 Feb 2018 21:04:12 -0500
changeset 36468 93228b2a1fc0
parent 36467 745b0df08514
child 36469 02cd2fb6de72
run-tests: don't mask errors when a server fails to start There are sporadic instances of this on Windows. They seem to happen more frequently after the test machine is rebooted, although the only way to hit it on my laptop is to loop certain tests with -j9 for hours. The problem with masking out the specific failure is that there's no way to know if it's the same line in the test that's failing, or if it is random. The justification for adding this masking in 52e9e63f1495 was that the failures occur regularly, but that's not the case anymore. The port number is still printed, in case that turns out to be useful.
tests/run-tests.py
tests/test-run-tests.t
--- a/tests/run-tests.py	Mon Feb 26 17:27:08 2018 +0530
+++ b/tests/run-tests.py	Sun Feb 25 21:04:12 2018 -0500
@@ -1763,19 +1763,19 @@
                 servefail, lines = getdiff(expected, got,
                                            test.refpath, test.errpath)
                 if servefail:
-                    raise test.failureException(
+                    self.stream.write(
                         'server failed to start (HGPORT=%s)' % test._startport)
-                else:
-                    self.stream.write('\n')
-                    for line in lines:
-                        line = highlightdiff(line, self.color)
-                        if PYTHON3:
-                            self.stream.flush()
-                            self.stream.buffer.write(line)
-                            self.stream.buffer.flush()
-                        else:
-                            self.stream.write(line)
-                            self.stream.flush()
+
+                self.stream.write('\n')
+                for line in lines:
+                    line = highlightdiff(line, self.color)
+                    if PYTHON3:
+                        self.stream.flush()
+                        self.stream.buffer.write(line)
+                        self.stream.buffer.flush()
+                    else:
+                        self.stream.write(line)
+                        self.stream.flush()
 
             # handle interactive prompt without releasing iolock
             if self._options.interactive:
--- a/tests/test-run-tests.t	Mon Feb 26 17:27:08 2018 +0530
+++ b/tests/test-run-tests.t	Sun Feb 25 21:04:12 2018 -0500
@@ -541,10 +541,16 @@
   >   $ echo 'abort: child process failed to start blah'
   > EOF
   $ rt test-serve-fail.t
+  server failed to start (HGPORT=*) (glob)
+  --- $TESTTMP/test-serve-fail.t
+  +++ $TESTTMP/test-serve-fail.t.err
+  @@ -1* +1,2 @@ (glob)
+     $ echo 'abort: child process failed to start blah'
+  +  abort: child process failed to start blah
   
   ERROR: test-serve-fail.t output changed
   !
-  Failed test-serve-fail.t: server failed to start (HGPORT=*) (glob)
+  Failed test-serve-fail.t: output changed
   # Ran 1 tests, 0 skipped, 1 failed.
   python hash seed: * (glob)
   [1]