summaryrefslogtreecommitdiffstats
path: root/tools/cuda-ab/soak.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tools/cuda-ab/soak.sh')
-rwxr-xr-xtools/cuda-ab/soak.sh15
1 files changed, 14 insertions, 1 deletions
diff --git a/tools/cuda-ab/soak.sh b/tools/cuda-ab/soak.sh
index f870fda..4f1430f 100755
--- a/tools/cuda-ab/soak.sh
+++ b/tools/cuda-ab/soak.sh
@@ -135,6 +135,19 @@ run_one() {
r="$(gssh "cat $out 2>/dev/null")" || true
[ -n "$r" ] && text="$r"
printf '%s' "$text" | grep -q 'EXIT=' && break
+ # The guest wrapper's EXIT= marker can be lost when the guest's
+ # process reaping stalls (observed: the client reached STATUS OK
+ # but its zombie was never reaped and `timeout` never wrote the
+ # marker). A terminal STATUS line is proof of completion by
+ # itself - accept it after a short grace so the EXIT= marker
+ # still wins when it does arrive.
+ if printf '%s' "$text" | grep -qE 'STATUS (OK|FAIL)'; then
+ sleep 10
+ r="$(gssh "cat $out 2>/dev/null")" || true
+ [ -n "$r" ] && text="$r"
+ printf '%s' "$text" | grep -q 'EXIT=' && break
+ break
+ fi
tnow=$(date +%s)
if [ $((tnow - t0)) -gt $((TMO + 120)) ]; then
if client_alive "$bin"; then
@@ -179,7 +192,7 @@ log "SOAK START mode=$MODE seconds=$SECS guest_dir=$GUEST_DIR timeout=${TMO}s lo
# cannot silently shrink the battery.
found=""
for i in 1 2 3; do
- found="$(gssh "for b in $CLIENTS; do [ -x $GUEST_DIR/\$b ] && echo \$b; done")" || found=""
+ found="$(gssh "for b in $CLIENTS; do [ -x $GUEST_DIR/\$b ] && echo \$b; done; true")" || found=""
[ -n "$found" ] && break
sleep 3
done