Skip to content

Commit

Permalink
Fix tunnelmole step in HIL tests.
Browse files Browse the repository at this point in the history
Prior to this commit, tunnelmole was launched in the background and the GitHub
job would proceed once the tmole.log file existed. The problem is that the next
step depends on the environment variable MD5SRV_URL being set, and tmole.log
gets created before that gets set. The result is that the next step may run
prematurely, before MD5SRV_URL is set, causing that step to fail. The solution
is to use a "ready" file. The tunnelmole step doesn't proceed until this file
is created. run_tunnelmole.sh only creates this file once it has done
everything it needs to, which includes setting MD5SRV_URL.
  • Loading branch information
haydenroche5 committed Dec 6, 2023
1 parent 7ef2184 commit e2a0c91
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/notecard-binary-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ jobs:
run: |
bash ./scripts/run_tunnelmole.sh
wait-on:
# just a dummy wait-on since this is required.
file:${{github.workspace}}/tmole.log
file:${{github.workspace}}/tmole_ready
log-output-if: true

- name: Check server is available
run: |
Expand Down
2 changes: 2 additions & 0 deletions scripts/run_tunnelmole.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ set -e

[ -n "$MD5SRV_PORT" ] || (echo "MD5SRV_PORT not set" && exit 1)
which tmole
rm -f tmole_ready
tmole $MD5SRV_PORT > tmole.log 2>&1 &
TMOLE_PID=$!
echo "TMOLE_PID=$TMOLE_PID"
Expand All @@ -20,3 +21,4 @@ echo "MD5SRV_URL=$MD5SRV_URL"
echo "MD5SRV_URL=$MD5SRV_URL" >> $GITHUB_ENV
sleep 2
echo "Tunnel mole started. Writing logs to `realpath tmole.log`"
touch tmole_ready

0 comments on commit e2a0c91

Please sign in to comment.