Skip to content

Commit c2cdd58

Browse files
authored
Merge pull request #4701 from grandixximo/ui-smoke-quit-teardown
tests/ui-smoke: let linuxcnc shut down before signalling its group
2 parents 5475b09 + deeeb70 commit c2cdd58

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

‎tests/tp/circle-curvature/test.sh‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#!/bin/sh
22
set -e
33

4-
# shellcheck disable=SC2086
5-
${SUDO} halcompile --install curvaturecheck.c >/dev/null
4+
halcompile --install curvaturecheck.c >/dev/null
65
halrun curvature.hal
76
echo 'circle curvature: OK'

‎tests/ui-smoke/_lib/quit-launch.sh‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,17 @@ xvfb-run -a --server-args="-screen 0 $UI_SMOKE_XVFB_SCREEN" \
165165
RC=0
166166
fi
167167
168+
# A GUI that quit makes linuxcnc shut down by itself; let it.
169+
# A SIGTERM to the group while it unloads kills the halcmd and
170+
# rtapi_app clients halfway, and linuxcnc then unloads a second
171+
# time on top of the first, leaving shared memory behind.
172+
if [ "$RC" = 0 ]; then
173+
for _ in $(seq 30); do
174+
kill -0 "$LINUXCNC_PID" 2>/dev/null || break
175+
sleep 1
176+
done
177+
fi
178+
168179
# Tear down whatever is left (task/motion, or the GUI on failure).
169180
kill -TERM -- -"$LINUXCNC_PID" 2>/dev/null || true
170181
for _ in $(seq 30); do

0 commit comments

Comments
 (0)