Skip to content

Commit

Permalink
CI: Really run fuzzer for 2 minutes
Browse files Browse the repository at this point in the history
  • Loading branch information
ibc committed Feb 20, 2024
1 parent b34a3b7 commit 3340c96
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/mediasoup-worker-fuzzer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,6 @@ jobs:
- name: invoke -r worker fuzzer
run: invoke -r worker fuzzer

# We don't run mediasoup-worker-fuzzer (maybe in the future).
# Run mediasoup-worker-fuzzer for 2 minutes.
- name: ./scripts/run-fuzzer.sh 120
run: ./scripts/run-fuzzer.sh 120
34 changes: 34 additions & 0 deletions worker/scripts/run-fuzzer.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/env bash

WORKER_PWD=${PWD}
DURATION_SEC=$1

current_dir_name=${WORKER_PWD##*/}
if [ "${current_dir_name}" != "worker" ] ; then
echo ">>> [ERROR] $(basename $0) must be called from mediasoup/worker directory" >&2
exit 1
fi

if [ "$#" -eq 0 ]; then
echo ">>> [ERROR] duration (in seconds) must be fiven as argument" >&2
exit 1
fi

# Run mediasoup-worker-fuzzer in background, get its pid, wait for given
# duration and then kill mediasoup-worker-fuzzer. If still running, kill
# will return status code 0, otherwise 1 (which means that the
# mediasoup-worker-fuzzer binary already exited due to some fuzzer or other
# error).
make fuzzer-run-all &
MEDIASOUP_WORKER_FUZZER_PID=$!
sleep ${DURATION_SEC}
kill ${MEDIASOUP_WORKER_FUZZER_PID}
status=$?;

if [ "${status}" -eq 0 ]; then
echo ">>> [INFO] mediasoup-worker-fuzzer still running so no fuzzer issue so far"
exit 0
else
echo ">>> [ERROR] mediasoup-worker-fuzzer not running so it existed already" >&2
exit ${status}
fi

0 comments on commit 3340c96

Please sign in to comment.