Skip to content

Commit

Permalink
Fix CI script for running simulator in background
Browse files Browse the repository at this point in the history
Don't hardcode bin path inside the tox env (should be on the PATH), also
check early if the process died for some reason.
  • Loading branch information
sk1p committed Feb 29, 2024
1 parent 4f02a6d commit 4dc3ec2
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions ci/run-with-sim.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

set -eu

.tox/notebooks/bin/libertem-live-mib-sim --host 127.0.0.1 "$TESTDATA_BASE_PATH/20200518 165148/default.hdr" --cached=MEMFD --wait-trigger&
libertem-live-mib-sim --host 127.0.0.1 "$TESTDATA_BASE_PATH/20200518 165148/default.hdr" --cached=MEMFD --wait-trigger&
MERLIN_SIM_PID=$!

.tox/notebooks/bin/libertem-live-dectris-sim "$TESTDATA_BASE_PATH/dectris/zmqdump.dat.128x128-id34-exte-bslz4" --port 8910 --zmqport 9999&
libertem-live-dectris-sim "$TESTDATA_BASE_PATH/dectris/zmqdump.dat.128x128-id34-exte-bslz4" --port 8910 --zmqport 9999&
DECTRIS_SIM_PID=$!

cleanup() {
Expand All @@ -20,6 +20,20 @@ cleanup() {

trap cleanup EXIT

sleep 1

# check if the subprocesses failed already:

if ! test -d /proc/"$MERLIN_SIM_PID"/; then
echo "merlin sim failed to start"
exit 1
fi

if ! test -d /proc/"$DECTRIS_SIM_PID"/; then
echo "dectris sim failed to start"
exit 1
fi

echo "started merlin simulator in background, pid=$MERLIN_SIM_PID"
echo "started dectris simulator in background, pid=$DECTRIS_SIM_PID"
echo "waiting for data sockets to be ready..."
Expand Down

0 comments on commit 4dc3ec2

Please sign in to comment.