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

login
register
mail settings
Submitter Augie Fackler
Date Oct. 10, 2014, 3:14 p.m.
Message ID <32533d333ad47871be09.1412954072@arthedain.pit.corp.google.com>
Download mbox | patch
Permalink /patch/6179/
State Accepted
Headers show

Comments

Augie Fackler - Oct. 10, 2014, 3:14 p.m.
# HG changeset patch
# User Augie Fackler <raf@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.
Augie Fackler - Oct. 10, 2014, 3:18 p.m.
On Fri, Oct 10, 2014 at 11:14 AM, Augie Fackler <raf@durin42.com> wrote:
> # HG changeset patch
> # User Augie Fackler <raf@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.

I'm not going to sink any more time into this bug right now, so if
someone else wants to tinker with this please do.

> +  python hash seed: * (glob)
> +  [1]
> +  $ rm test-serve-fail.t
> +
>  Running In Debug Mode
>  ======================
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel

Patch

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
 ======================