From 99248aac36405cec2446b66c6ca1c73d6c0da238 Mon Sep 17 00:00:00 2001 From: matt Date: Sun, 18 Oct 2026 03:33:19 -0700 Subject: [PATCH] jenkinsfile - watch screen test run kill loop in detached screen, neat idea intern --- api/Jenkinsfile.ble_test | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/api/Jenkinsfile.ble_test b/api/Jenkinsfile.ble_test index 6a6777f..fd2f413 100644 --- a/api/Jenkinsfile.ble_test +++ b/api/Jenkinsfile.ble_test @@ -84,15 +84,17 @@ pipeline { sh """ ssh -o StrictHostKeyChecking=no root@${params.host_ip} -o ServerAliveInterval=60 -o ServerAliveCountMax=120 << EOF echo Running background termination loop I hope... - nohup sh -c ' - sleep 10 + screen -dmS ble_test_watchdog_${env.TEST_HASH} sh -c ' + while ! pgrep -f "tail.*ble_test_${env.TEST_HASH}" > /dev/null; do + sleep 1 + done while pgrep -f "tail.*ble_test_${env.TEST_HASH}" > /dev/null; do if ! screen -list | grep -q ble_test_${env.TEST_HASH}; then pkill -9 -f "tail.*ble_test_${env.TEST_HASH}" fi sleep 5 done - ' & + ' """ } }