[PATCH in-crew exposes-bug] test-run-tests: add a test for detection of failure to start a server

Augie Fackler raf at durin42.com
Fri Oct 10 10:14:32 CDT 2014


# HG changeset patch
# User Augie Fackler <raf at durin42.com>
# Date 1412951692 14400
#      Fri Oct 10 10:34:52 2014 -0400
# Node ID 32533d333ad47871be09852129a47c02d3d3c169
# Parent  4d95dafeca7634daadb83244b82d29d63dba4190
test-run-tests: add a test for detection of failure to start a server

This also highlights a bug: right now we print "2 failed" but we only
ran one test.

diff --git a/tests/test-run-tests.t b/tests/test-run-tests.t
--- a/tests/test-run-tests.t
+++ b/tests/test-run-tests.t
@@ -156,6 +156,27 @@
   python hash seed: * (glob)
   [1]
 
+Verify that when a process fails to start we show a useful message
+==================================================================
+NOTE: there is currently a bug where this shows "2 failed" even though
+it's actually the same test being reported for failure twice.
+
+  $ cat > test-serve-fail.t <<EOF
+  >   $ echo 'abort: child process failed to start blah'
+  > EOF
+  $ $TESTDIR/run-tests.py --with-hg=`which hg` test-serve-fail.t
+  
+  ERROR: test-serve-fail.t output changed
+  !
+  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, 0 warned, 2 failed.
+  python hash seed: * (glob)
+  [1]
+  $ rm test-serve-fail.t
+
 Running In Debug Mode
 ======================
 


More information about the Mercurial-devel mailing list