Skip to content

Commit fad0379

Browse files
committed
ci: QEMU esp32c3: There is no kill like overkill
1 parent 0370733 commit fad0379

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

examples/esp32c3/runner.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,18 @@ sleep 3s
3333
echo q | nc -N 127.0.0.1 55555 >>"$tempdir"/$qemuoutputfile 2>&1
3434
# Output that will be compared must be printed to stdout
3535

36+
sleep 0.1s
37+
# If still running, try again nicely
38+
pgrep -af "qemu-system.*" >/dev/null 2>&1 && echo q | nc -N 127.0.0.1 55555 >>"$tempdir"/$qemuoutputfile 2>&1
39+
40+
# Ask a bit more firmly with SIGTERM
41+
pgrep -af "qemu-system.*" >/dev/null 2>&1 && kill $qemupid >/dev/null 2>&1
42+
43+
pgrep -af "qemu-system.*" >/dev/null 2>&1 && sleep 0.1s >/dev/null 2>&1
44+
45+
# Time to die
46+
pgrep -af "qemu-system.*" >/dev/null 2>&1 && kill -9 $qemupid >/dev/null 2>&1
47+
3648
# Make boot phase silent, for debugging change, run with e.g. $ `env DEBUGGING=true` cargo xtask....
3749
if [ -n "${DEBUGGING}" ]; then
3850
# Debugging: strip leading "I (xyz)" where xyz is an incrementing number, and esp_image specifics

0 commit comments

Comments
 (0)