mirror of
https://github.com/facebook/sapling.git
synced 2024-10-09 16:31:02 +03:00
test-lfs: allow the test server to be killed on Windows
Apparently '$!' doesn't return a Win32 PID, so the process was never killed, and the next run was screwed up. Oddly, without the explicit killdaemons.py at the end, the test seems to hang. This spawning is just sad, so I limited it to Windows.
This commit is contained in:
parent
bef85d8500
commit
555700adde
@ -4,8 +4,26 @@
|
||||
$ LFS_HOST="localhost:$HGPORT"
|
||||
$ LFS_PUBLIC=1
|
||||
$ export LFS_LISTEN LFS_HOST LFS_PUBLIC
|
||||
#if no-windows
|
||||
$ lfs-test-server &> lfs-server.log &
|
||||
$ echo $! >> $DAEMON_PIDS
|
||||
#else
|
||||
$ cat >> $TESTTMP/spawn.py <<EOF
|
||||
> import os
|
||||
> import subprocess
|
||||
> import sys
|
||||
>
|
||||
> for path in os.environ["PATH"].split(os.pathsep):
|
||||
> exe = os.path.join(path, 'lfs-test-server.exe')
|
||||
> if os.path.exists(exe):
|
||||
> with open('lfs-server.log', 'wb') as out:
|
||||
> p = subprocess.Popen(exe, stdout=out, stderr=out)
|
||||
> sys.stdout.write('%s\n' % p.pid)
|
||||
> sys.exit(0)
|
||||
> sys.exit(1)
|
||||
> EOF
|
||||
$ $PYTHON $TESTTMP/spawn.py >> $DAEMON_PIDS
|
||||
#endif
|
||||
|
||||
$ cat >> $HGRCPATH <<EOF
|
||||
> [extensions]
|
||||
@ -104,3 +122,5 @@ Check error message when object does not exist:
|
||||
updating to branch default
|
||||
abort: LFS server error. Remote object for file data/a.i not found:(.*)! (re)
|
||||
[255]
|
||||
|
||||
$ $PYTHON $RUNTESTDIR/killdaemons.py $DAEMON_PIDS
|
||||
|
Loading…
Reference in New Issue
Block a user