Skip to content

Commit

Permalink
Correct path and correct exit for WPR (#108)
Browse files Browse the repository at this point in the history
  • Loading branch information
soulgalore authored Dec 18, 2024
1 parent 21b131f commit a4dc821
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions testrunner/wpr/replay.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@ set -eu
BROWSERTIME=sitespeed.io-wpr
SITESPEEDIO=sitespeed.io

# Get the script directory
cd "$(dirname "$0")"
MY_DIR="$(pwd)"

# WebPageReplay setup
WPR_BINARY=wpr
WPR_CERT_FILE=./wpr/wpr_cert.pem
WPR_KEY_FILE=./wpr/wpr_key.pem
WPR_SCRIPTS=./wpr/deterministic.js
WPR_CERT_FILE="$MY_DIR"/wpr_cert.pem
WPR_KEY_FILE="$MY_DIR"/wpr_key.pem
WPR_SCRIPTS="$MY_DIR"/deterministic.js
WPR_HTTP_PORT=8085
WPR_HTTPS_PORT=8086
WPR_ARCHIVE=/tmp/archive.wprgo
Expand Down Expand Up @@ -69,11 +73,12 @@ then
"$SITESPEEDIO" "$@" --browsertime.firefox.preference security.OCSP.enabled:0 --browsertime.firefox.preference network.dns.forceResolve:127.0.0.1 --browsertime.chrome.webPageReplayHostResolver --browsertime.chrome.webPageReplayHTTPPort $WPR_HTTP_PORT --browsertime.chrome.webPageReplayHTTPSPort $WPR_HTTPS_PORT --replay &
SITESPEEDIO_PID=$!
wait $SITESPEEDIO_PID
if kill -0 $REPLAY_PID 2>/dev/null; then
kill -2 $REPLAY_PID
wait $REPLAY_PID
if kill -0 "$REPLAY_PID" 2>/dev/null; then
kill -s SIGTERM "$REPLAY_PID"
echo 'Stopped WebPageReplay replay'
else
echo "Replay PID $REPLAY_PID is not running."
fi
echo 'Stopped WebPageReplay replay'
else
echo "Replay server didn't start correctly, check the logs $WPR_REPLAY_LOG" >&2
fi
Expand Down

0 comments on commit a4dc821

Please sign in to comment.