# HG changeset patch # User Simon Heimberg # Date 2013-11-25 21:00:46 # Node ID 52e9e63f1495df4100a4c6e191502ddd5a15718f # Parent 422981492ace89070b019df90c385b4c883742ce run-tests: test result shows when a failed test could not start a server Failing to start a server happens regularly, at least on windows buildbot. Such a failure often has nothing to do with the test, but with the environment. But half the test output can change because some data is missing. Therefore this is worth an extended error message. Detect the server failure in the diff output because it is most reliable there. Checking the output only does not show if the server failure was expected. Old failure message when server start failed: Failed test-serve.t: output changed New message: Failed test-serve.t: serve failed and output changed diff --git a/tests/run-tests.py b/tests/run-tests.py --- a/tests/run-tests.py +++ b/tests/run-tests.py @@ -304,8 +304,14 @@ def parsehghaveoutput(lines): def showdiff(expected, output, ref, err): print + servefail = False for line in difflib.unified_diff(expected, output, ref, err): sys.stdout.write(line) + if not servefail and line.startswith( + '+ abort: child process failed to start'): + servefail = True + return {'servefail': servefail} + verbose = False def vlog(*msg): @@ -1028,17 +1034,21 @@ def runone(options, test, count): elif ret == 'timeout': result = fail("timed out", ret) elif out != refout: + info = {} if not options.nodiff: iolock.acquire() if options.view: os.system("%s %s %s" % (options.view, ref, err)) else: - showdiff(refout, out, ref, err) + info = showdiff(refout, out, ref, err) iolock.release() + msg = "" + if info.get('servefail'): msg += "serve failed and " if ret: - result = fail("output changed and " + describe(ret), ret) + msg += "output changed and " + describe(ret) else: - result = fail("output changed", ret) + msg += "output changed" + result = fail(msg, ret) elif ret: result = fail(describe(ret), ret) else: