changeset 1744:385b06493465

make server tests use --daemon.
author Vadim Gelfer <vadim.gelfer@gmail.com>
date Fri, 17 Feb 2006 21:55:33 -0800
parents 1e5bb6c929cd
children 1dfc8e94108f
files tests/test-archive tests/test-archive.out tests/test-pull tests/test-pull.out
diffstat 4 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-archive	Sat Feb 18 05:40:08 2006 +0100
+++ b/tests/test-archive	Fri Feb 17 21:55:33 2006 -0800
@@ -18,8 +18,8 @@
 echo "allowzip = true" >> .hg/hgrc
 echo "allowgz = true" >> .hg/hgrc
 echo "allowbz2 = true" >> .hg/hgrc
-hg serve -p 20059 > /dev/null &
-sleep 1 # wait for server to be started
+serverpid=`mktemp`
+hg serve -p 20059 -d --pid-file=$serverpid
 
 TIP=`hg id -v | cut -f1 -d' '`
 QTIP=`hg id -q`
@@ -35,4 +35,5 @@
 http_proxy= python getarchive.py "$TIP" zip > archive.zip
 unzip -t archive.zip | sed "s/$QTIP/TIP/"
 
-kill $!
+kill `cat $serverpid`
+rm $serverpid
--- a/tests/test-archive.out	Sat Feb 18 05:40:08 2006 +0100
+++ b/tests/test-archive.out	Fri Feb 17 21:55:33 2006 -0800
@@ -12,4 +12,3 @@
     testing: test-archive-TIP/baz/bletch   OK
     testing: test-archive-TIP/foo   OK
 No errors detected in compressed data of archive.zip.
-killed!
--- a/tests/test-pull	Sat Feb 18 05:40:08 2006 +0100
+++ b/tests/test-pull	Fri Feb 17 21:55:33 2006 -0800
@@ -7,8 +7,8 @@
 hg addremove
 hg commit -m 1
 hg verify
-hg serve -p 20059 > /dev/null &
-sleep 1 # wait for server to be started
+serverpid=`mktemp`
+hg serve -p 20059 -d --pid-file=$serverpid
 cd ..
 
 hg clone http://localhost:20059/ copy
@@ -19,4 +19,5 @@
 hg manifest
 hg pull
 
-kill $!
+kill `cat $serverpid`
+rm $serverpid
--- a/tests/test-pull.out	Sat Feb 18 05:40:08 2006 +0100
+++ b/tests/test-pull.out	Fri Feb 17 21:55:33 2006 -0800
@@ -19,4 +19,3 @@
 pulling from http://localhost:20059/
 searching for changes
 no changes found
-killed!