Changeset 26763


Ignore:
Timestamp:
01/10/22 20:10:07 (3 years ago)
Author:
jdquinn
Message:

CHG: Added timeout to Windows testing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/jenkins/jenkins.sh

    r26762 r26763  
    374374                echo "pid: ${pid}"
    375375                echo '-----------------------------'
    376                 while [ -n "${pid}" ]; do
     376                # Time out after $max_time seconds because sometimes multiple MATLAB processes get locked in race condition
     377                timer=0
     378                max_time=3600
     379                while [[ timer -lt ${max_time} && -n "${pid}" ]]; do
    377380                        pid=$(ps -W | grep MATLAB | awk '{print $1}')
     381                        timer=$((timer + 1))
    378382                        sleep 1;
    379383                done
     384                # Check if timer hit $max_time
     385                if [ $timer -eq $max_time ]; then
     386                        echo "Testing timed out"
     387                        # Kill MATLAB processes
     388                        pid=$(ps -W | grep MATLAB | awk '{print $1}')
     389                        /bin/kill -f "${pid}"
     390                        exit 1
     391                fi
    380392        else
    381393                wait
Note: See TracChangeset for help on using the changeset viewer.