commit - f6f8289012aca18a8636d0d313bd4b3fc813e508c6d6110d5d6d972bcda27b34
commit + 9778d2876fc9a317915e6414586744e726ef5622e196389ede565f81383a036e
blob - 8d130358a071c18b21379c798bc43657d3ec5ced19d196a7dfb4b9c216b62ebf
blob + 74d24f12e750bb8ea0cf0e6f52b95c3e2485d10776482bc5bae849ee1fc53a2a
--- regress/cmdline/clone.sh
+++ regress/cmdline/clone.sh
timeout 20 ./http-server -p $GOT_TEST_HTTP_PORT $testroot \
> $testroot/http-server.log &
- trap "kill %1" HUP INT QUIT PIPE TERM
- while ! grep -q 'ready' $testroot/http-server.log; do
- sleep 1 # server starts up
+ sleep 1 # server starts up
+ for i in 1 2 3 4; do
+ if grep -q ': ready' $testroot/http-server.log; then
+ break
+ fi
+ if [ $i -eq 4 ]; then
+ echo "http-server startup timeout" >&2
+ test_done "$testroot" "1"
+ # timeout(1) will kill the server eventually
+ return 1
+ fi
+ sleep 1 # server is still starting up
done
+ http_pid=`head -n 1 $testroot/http-server.log | cut -d ':' -f1`
+ trap "kill -9 $http_pid; wait $http_pid" HUP INT QUIT PIPE TERM
+
# Test our custom HTTP server with git clone. Should succeed.
git clone -q $testurl/repo $testroot/repo-clone-with-git
ret=$?
return 1
fi
- kill %1
- wait %1 # wait for http-server
+ kill $http_pid
+ wait $http_pid
got log -l0 -p -r $testroot/repo > $testroot/log-repo
ret=$?
blob - 444370a2a0851cb8d83fb854d8d869064c16bf8bec8455e087f01140d24d812e
blob + 0018862da4eae0ac26fae39ee326c8f08450f26e2fde0e7747332a096935a4be
--- regress/cmdline/fetch.sh
+++ regress/cmdline/fetch.sh
timeout 20 ./http-server -p $GOT_TEST_HTTP_PORT $testroot \
> $testroot/http-server.log &
- trap "kill %1" HUP INT QUIT PIPE TERM
- while ! grep -q 'ready' $testroot/http-server.log; do
- sleep 1 # server starts up
+ sleep 1 # server starts up
+ for i in 1 2 3 4; do
+ if grep -q ': ready' $testroot/http-server.log; then
+ break
+ fi
+ if [ $i -eq 4 ]; then
+ echo "http-server startup timeout" >&2
+ test_done "$testroot" "1"
+ # timeout(1) will kill the server eventually
+ return 1
+ fi
+ sleep 1 # server is still starting up
done
+ http_pid=`head -n 1 $testroot/http-server.log | cut -d ':' -f1`
+ trap "kill -9 $http_pid; wait $http_pid" HUP INT QUIT PIPE TERM
+
got clone -q $testurl/repo $testroot/repo-clone
ret=$?
if [ $ret -ne 0 ]; then
return 1
fi
- kill %1
- wait %1 # wait for http-server
+ kill $http_pid
+ wait $http_pid
echo -n > $testroot/stdout.expected
blob - bfc0d7981e3f8cafc18fb3c90f86e071388bbe1c64974188fa7af65cbb429a0a
blob + fc4c81e0147e0fff0f65e1fa843f50419ca0711bf5c77d21b00a6594bf033ce6
--- regress/cmdline/http-server
+++ regress/cmdline/http-server
}
STDOUT->autoflush(1);
-printf "ready\n";
+printf "$$: ready\n";
while (1) {
my $client = $server->accept();