diff --git a/CI/scripts/targeting_designs.sh b/CI/scripts/targeting_designs.sh index 4d988a16..87d069de 100644 --- a/CI/scripts/targeting_designs.sh +++ b/CI/scripts/targeting_designs.sh @@ -16,14 +16,16 @@ MLPATH=/opt/MATLAB cd ../.. source /opt/Xilinx/Vivado/2022.2/settings64.sh -Xvfb :77 & -export DISPLAY=:77 +# Randomize DISPLAY number to avoid conflicts +export DISPLAY_ID=:$(shuf -i 10-1000 -n 1) +Xvfb :$DISPLAY_ID & +XVFB_PID=$! +export DISPLAY=:$DISPLAY_ID export SWT_GTK3=0 source /opt/Xilinx/Vivado/2022.2/settings64.sh $MLPATH/$MLRELEASE/bin/matlab $MLFLAGS -r "addpath(genpath('test'));addpath(genpath('deps'));runDemoTests('$DEMO');" EC=$? -pidof Xvfb -if [ $? -eq 0 ]; then - kill -9 `pidof Xvfb` -fi -exit $EC \ No newline at end of file +sleep 5 +kill -9 $XVFB_PID || true +exit $EC +