Skip to content

Commit d8da80b

Browse files
fix(e2e): propagate failures from parallel LINSTOR pool jobs
Address review feedback on hack/e2e-post-install-prep.sh:31: POSIX `wait` without arguments returns 0 even if a backgrounded `kubectl exec` failed, which would mask partial LINSTOR prep failures and let downstream tests run on a half-provisioned cluster. Collect each background PID and `wait "$pid"` per job so `set -e` exits the script on the first failed pool creation. Assisted-By: Claude <[email protected]> Signed-off-by: Myasnikov Daniil <[email protected]>
1 parent 7ed6444 commit d8da80b

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎hack/e2e-post-install-prep.sh‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,17 @@ timeout 60 sh -ec 'until [ $(kubectl exec -n cozy-linstor deploy/linstor-control
2222

2323
echo "[post-install-prep] creating LINSTOR storage pools (parallel across nodes)"
2424
created_pools=$(kubectl exec -n cozy-linstor deploy/linstor-controller -- linstor sp l -s data --pastable | awk '$2 == "data" {printf " " $4} END{printf " "}')
25+
pids=""
2526
for node in srv1 srv2 srv3; do
2627
case $created_pools in
2728
*" $node "*) echo " pool 'data' already exists on $node"; continue;;
2829
esac
2930
kubectl exec -n cozy-linstor deploy/linstor-controller -- linstor ps cdp zfs ${node} /dev/vdc --pool-name data --storage-pool data &
31+
pids="$pids $!"
32+
done
33+
for pid in $pids; do
34+
wait "$pid"
3035
done
31-
wait
3236

3337
echo "[post-install-prep] applying StorageClasses"
3438
kubectl apply -f - <<'EOF'

0 commit comments

Comments
 (0)