Patchwork [2,of,2] tests: test that the pid returned by `hg serve` looks reasonable

login
register
mail settings
Submitter Simon Heimberg
Date Feb. 10, 2014, 2:37 p.m.
Message ID <ecc981ae1ad9d94502ee.1392043043@lapsi.heimberg.home>
Download mbox | patch
Permalink /patch/3541/
State Accepted
Commit 00f2d29308db2b0a04017961cd05e72ee93116d6
Headers show

Comments

Simon Heimberg - Feb. 10, 2014, 2:37 p.m.
# HG changeset patch
# User Simon Heimberg <simohe@besonet.ch>
# Date 1391901961 -3600
#      Sun Feb 09 00:26:01 2014 +0100
# Node ID ecc981ae1ad9d94502ee755ad5ef877b1d83f4d5
# Parent  1277051454b64dfd5b34d6fd8588f448be2ff47f
tests: test that the pid returned by `hg serve` looks reasonable

This failed on windows before win32.spawndetached has been fixed. The process
name was "cmd.exe" and not "hg.exe" or "python.exe".
Simon Heimberg - Feb. 15, 2014, 6:38 p.m.
I suggest to backout this (00f2d29308db).

It fails on windows buildbot because tasklist is not found. According to 
[1] it should be available, but... It works on this machine, but this is 
not a realy help.

And on any other os, the test does not help a lot. Even if a wrong pid 
is returned, it is likely from a python process, because the test runner 
is also a python process.
Plus it is still broken on OS-X. A patch has been sent and queued, but 
not yet applied. And as said before, it is not really worth the effort.


[1] http://technet.microsoft.com/en-us/library/cc730909.aspx

On 10.02.2014 15:37, schrieb Simon Heimberg:
> # HG changeset patch
> # User Simon Heimberg <simohe@besonet.ch>
> # Date 1391901961 -3600
> #      Sun Feb 09 00:26:01 2014 +0100
> # Node ID ecc981ae1ad9d94502ee755ad5ef877b1d83f4d5
> # Parent  1277051454b64dfd5b34d6fd8588f448be2ff47f
> tests: test that the pid returned by `hg serve` looks reasonable
>
> This failed on windows before win32.spawndetached has been fixed. The process
> name was "cmd.exe" and not "hg.exe" or "python.exe".
>
> diff -r 1277051454b6 -r ecc981ae1ad9 tests/test-treediscovery.t
> --- a/tests/test-treediscovery.t	Sat Feb 08 14:35:07 2014 +0100
> +++ b/tests/test-treediscovery.t	Sun Feb 09 00:26:01 2014 +0100
> @@ -29,6 +29,15 @@
>     $ hg init empty1
>     $ hg init empty2
>     $ tstart empty2
> +check if process of pid looks reasonable ('hg' normally, 'python' for run-tests.py -l)
> +#if windows
> +ps of mingw does not support -p, tasklist is on any windows machine since XP
> +  $ tasklist //NH //fi "pid eq `cat hg.pid`" | grep '  '
> +  (.* )?(hg|python)\.exe( .*)? (re)
> +#else
> +  $ ps --no-heading -p `cat hg.pid`
> +  (.* )?(hg|python)( .*)? (re)
> +#endif
>     $ hg incoming -R empty1 $remote
>     comparing with http://localhost:$HGPORT/
>     no changes found
>
Matt Mackall - Feb. 16, 2014, 4:13 a.m.
On Sat, 2014-02-15 at 19:38 +0100, Simon Heimberg wrote:
> I suggest to backout this (00f2d29308db).

Done, thanks.

Patch

diff -r 1277051454b6 -r ecc981ae1ad9 tests/test-treediscovery.t
--- a/tests/test-treediscovery.t	Sat Feb 08 14:35:07 2014 +0100
+++ b/tests/test-treediscovery.t	Sun Feb 09 00:26:01 2014 +0100
@@ -29,6 +29,15 @@ 
   $ hg init empty1
   $ hg init empty2
   $ tstart empty2
+check if process of pid looks reasonable ('hg' normally, 'python' for run-tests.py -l)
+#if windows
+ps of mingw does not support -p, tasklist is on any windows machine since XP
+  $ tasklist //NH //fi "pid eq `cat hg.pid`" | grep '  '
+  (.* )?(hg|python)\.exe( .*)? (re)
+#else
+  $ ps --no-heading -p `cat hg.pid`
+  (.* )?(hg|python)( .*)? (re)
+#endif
   $ hg incoming -R empty1 $remote
   comparing with http://localhost:$HGPORT/
   no changes found