Skip to content

Commit

Permalink
tests: make g0 test more robust by waiting for linuxcnc to come up
Browse files Browse the repository at this point in the history
This should fix the failing test, as discovered here:
#2700 (comment)
  • Loading branch information
snowgoer540 committed Nov 3, 2023
1 parent a8aecc5 commit dce3e10
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/motion/g0/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,21 @@ wait_for_pin() {
linuxcnc motion-test.ini &
linuxcncpid=$!

# let linuxcnc come up
TOGO=80
while [ $TOGO -gt 0 ]; do
echo trying to connect to linuxcncrsh TOGO=$TOGO
if nc -z localhost 5007; then
break
fi
sleep 0.25
TOGO=$(($TOGO - 1))
done
if [ $TOGO -eq 0 ]; then
echo connection to linuxcncrsh timed out
exit 1
fi

wait_for_pin motion.in-position TRUE

echo starting to capture data
Expand Down

0 comments on commit dce3e10

Please sign in to comment.