Mercurial > hg
diff tests/test-http-branchmap.t @ 17467:448d0c452140
test-http-branchmap: enable on Windows
Tests using "hg serve --daemon" are currently disabled on Windows for
lack of proper kill utility. The one shipped with MinGW operates on
internal process identifiers and not on the ones recorded by hg serve.
Fortunately we can replace most of them by calls to killdaemons.py.
This patch is a proof of concept on how to run these tests on Windows.
The plan is:
- Check test-http-branchmap.t does not fail/hang on the buildbot
- Convert all kill utility calls to killdaemons.py calls.
- Add a rule in check-code.py to forbid kill calls, or ignore the
remaining ones (test-hup.t, etc.).
- Possibly drop the 'serve' rule from hghave.
The:
listening at http://*:$HGPORT1/
line does not appear on Windows because the detached process can no
longer write on its parent streams. Grepping hg serve stdout directly
causes the parent process to never return and hangs the test. This is a
bug, but I have no simple solution and prefer to pay this small price
and enable hg serve tests on Windows.
author | Patrick Mezard <patrick@mezard.eu> |
---|---|
date | Sun, 09 Sep 2012 12:31:14 +0200 |
parents | fc8c7a5ccc4a |
children | 7a9cbb315d84 |
line wrap: on
line diff
--- a/tests/test-http-branchmap.t Mon Aug 20 22:36:51 2012 +0200 +++ b/tests/test-http-branchmap.t Sun Sep 09 12:31:14 2012 +0200 @@ -1,7 +1,10 @@ - $ "$TESTDIR/hghave" serve || exit 80 + $ "$TESTDIR/hghave" killdaemons || exit 80 $ hgserve() { - > hg serve -a localhost -p $HGPORT1 -d --pid-file=hg.pid -E errors.log -v $@ + > hg serve -a localhost -p $HGPORT1 -d --pid-file=hg.pid \ + > -E errors.log -v $@ > startup.log + > # Grepping hg serve stdout would hang on Windows + > grep -v 'listening at' startup.log > cat hg.pid >> "$DAEMON_PIDS" > } $ hg init a @@ -12,7 +15,6 @@ $ hg -R a ci -Am foo adding foo $ hgserve -R a --config web.push_ssl=False --config web.allow_push=* --encoding latin1 - listening at http://*:$HGPORT1/ (bound to 127.0.0.1:$HGPORT1) (glob) $ hg --encoding utf-8 clone http://localhost:$HGPORT1 b requesting all changes adding changesets @@ -52,7 +54,7 @@ date: Thu Jan 01 00:00:00 1970 +0000 summary: foo - $ kill `cat hg.pid` + $ "$TESTDIR/killdaemons.py" hg.pid verify 7e7d56fe4833 (encoding fallback in branchmap to maintain compatibility with 1.3.x)