From 415ee616afdd4f1892410cdad8d24d9ac3bc977d Mon Sep 17 00:00:00 2001 From: Patrick Steinhardt Date: Fri, 12 Jul 2019 09:40:13 +0200 Subject: [PATCH] azure-pipelines: make gitdaemon tests work on Win32 On Win32 builds, the PID file created by git-daemon contained in invalid PID that we were not able to kill afterwards. Somehow, it seems like the contained PID was wrapped in braces. Consequentially, kill(1) failed and thus caused the build to error. Fix this by directly grabbing the PID of the spawned git-daemon process. --- azure-pipelines/test.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/azure-pipelines/test.sh b/azure-pipelines/test.sh index 69b4273a5..56d8264d9 100755 --- a/azure-pipelines/test.sh +++ b/azure-pipelines/test.sh @@ -16,9 +16,9 @@ SUCCESS=1 cleanup() { echo "Cleaning up..." - if [ ! -z "$GITDAEMON_DIR" -a -f "${GITDAEMON_DIR}/pid" ]; then + if [ ! -z "$GITDAEMON_PID" ]; then echo "Stopping git daemon..." - kill $(cat "${GITDAEMON_DIR}/pid") + kill $GITDAEMON_PID fi if [ ! -z "$SSHD_DIR" -a -f "${SSHD_DIR}/pid" ]; then @@ -73,7 +73,8 @@ if [ -z "$SKIP_GITDAEMON_TESTS" ]; then echo "Starting git daemon..." GITDAEMON_DIR=`mktemp -d ${TMPDIR}/gitdaemon.XXXXXXXX` git init --bare "${GITDAEMON_DIR}/test.git" - git daemon --listen=localhost --export-all --enable=receive-pack --pid-file="${GITDAEMON_DIR}/pid" --base-path="${GITDAEMON_DIR}" "${GITDAEMON_DIR}" 2>/dev/null & + git daemon --listen=localhost --export-all --enable=receive-pack --base-path="${GITDAEMON_DIR}" "${GITDAEMON_DIR}" 2>/dev/null & + GITDAEMON_PID=$! fi if [ -z "$SKIP_PROXY_TESTS" ]; then