From 37d4047af2c6cb111874ee7660e078886bf38fa8 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Mon, 27 Mar 2017 14:10:50 +0200 Subject: [PATCH] tests: Don't leak SimpleHTTPServers --- tests/test-webserver.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/test-webserver.sh b/tests/test-webserver.sh index 04fa02c7..3291b061 100755 --- a/tests/test-webserver.sh +++ b/tests/test-webserver.sh @@ -5,8 +5,10 @@ set -euo pipefail dir=$1 test_tmpdir=$(pwd) -(cd ${dir} && env PYTHONUNBUFFERED=1 setsid python -m SimpleHTTPServer 0 >${test_tmpdir}/httpd-output) & +cd ${dir} +env PYTHONUNBUFFERED=1 setsid python -m SimpleHTTPServer 0 >${test_tmpdir}/httpd-output & child_pid=$! + for x in $(seq 50); do sed -e 's,Serving HTTP on 0.0.0.0 port \([0-9]*\) \.\.\.,\1,' < ${test_tmpdir}/httpd-output > ${test_tmpdir}/httpd-port if ! cmp ${test_tmpdir}/httpd-output ${test_tmpdir}/httpd-port 1>/dev/null; then