From b6da7ddef6372ba87c820c3a818830f365de7a57 Mon Sep 17 00:00:00 2001 From: grvvy Date: Fri, 27 Feb 2026 13:01:07 -0700 Subject: [PATCH] wrap hub commands in timeout blocks --- Jenkinsfile | 108 +++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 99 insertions(+), 9 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 7079f972..31d8b64c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -20,14 +20,44 @@ pipeline { steps { sh './ci-scripts/install_host.sh' sh './ci-scripts/build_h1_firmware.sh' - sh 'hubs all off' + script { + try { + // Allow 10 seconds for the USB hub port power server to respond + timeout(time: 10, unit: 'SECONDS') { + sh 'hubs all off' + } + } catch (err) { + echo "USB hub port power server command timeout reached." + throw err + } + } retry(3) { - sh 'hubs h1_eut reset' + script { + try { + // Allow 10 seconds for the USB hub port power server to respond + timeout(time: 10, unit: 'SECONDS') { + sh 'hubs h1_eut reset' + } + } catch (err) { + echo "USB hub port power server command timeout reached." + throw err + } + } sh 'sleep 1s' sh './ci-scripts/test_host.sh' } retry(3) { - sh 'hubs h1_tester h1_eut reset' + script { + try { + // Allow 10 seconds for the USB hub port power server to respond + timeout(time: 10, unit: 'SECONDS') { + sh 'hubs h1_tester h1_eut reset' + } + } catch (err) { + echo "USB hub port power server command timeout reached." + throw err + } + } sh 'sleep 1s' sh '''python3 ci-scripts/hackrf_test.py --ci --log log \ --hostdir host/build/hackrf-tools/src/ \ @@ -37,7 +67,17 @@ pipeline { sh 'hubs all off' } retry(3) { - sh 'hubs h1_eut reset' + script { + try { + // Allow 10 seconds for the USB hub port power server to respond + timeout(time: 10, unit: 'SECONDS') { + sh 'hubs h1_eut reset' + } + } catch (err) { + echo "USB hub port power server command timeout reached." + throw err + } + } sh 'sleep 1s' sh 'python3 ci-scripts/test_sgpio_debug.py' } @@ -57,24 +97,74 @@ pipeline { steps { sh './ci-scripts/install_host.sh' sh './ci-scripts/build_hpro_firmware.sh' - sh 'hubs all off' + script { + try { + // Allow 10 seconds for the USB hub port power server to respond + timeout(time: 10, unit: 'SECONDS') { + sh 'hubs all off' + } + } catch (err) { + echo "USB hub port power server command timeout reached." + throw err + } + } retry(3) { - sh 'hubs hpro_eut reset' + script { + try { + // Allow 10 seconds for the USB hub port power server to respond + timeout(time: 10, unit: 'SECONDS') { + sh 'hubs hpro_eut reset' + } + } catch (err) { + echo "USB hub port power server command timeout reached." + throw err + } + } sh 'sleep 1s' sh './ci-scripts/test_host.sh' } retry(3) { - sh 'hubs hpro_tester hpro_eut reset' + script { + try { + // Allow 10 seconds for the USB hub port power server to respond + timeout(time: 10, unit: 'SECONDS') { + sh 'hubs hpro_tester hpro_eut reset' + } + } catch (err) { + echo "USB hub port power server command timeout reached." + throw err + } + } sh 'sleep 1s' sh '''python3 ci-scripts/hackrf_pro_test.py --ci --log log \ --hostdir host/build/hackrf-tools/src \ --fwupdate firmware/hackrf_usb/build \ --tester 0000000000000000a06063c82338145f \ --eut RunningFromRAM -p --rev r1.2''' - sh 'hubs all off' + script { + try { + // Allow 10 seconds for the USB hub port power server to respond + timeout(time: 10, unit: 'SECONDS') { + sh 'hubs all off' + } + } catch (err) { + echo "USB hub port power server command timeout reached." + throw err + } + } } retry(3) { - sh 'hubs hpro_eut reset' + script { + try { + // Allow 10 seconds for the USB hub port power server to respond + timeout(time: 10, unit: 'SECONDS') { + sh 'hubs hpro_eut reset' + } + } catch (err) { + echo "USB hub port power server command timeout reached." + throw err + } + } sh 'sleep 1s' sh 'python3 ci-scripts/test_sgpio_debug.py' }