Skip to content

Commit 0744cd7

Browse files
kvapsclaude
andcommitted
test(e2e): stop masking clone-cell failures with an unbound-variable abort
mapfile fed from a process substitution swallows the producer's exit status, so a wait_clone_replicas timeout left the nodes array empty and the cell died on 'cli_nodes[0]: unbound variable' under set -u, hiding the actual diagnostic. Capture the output through a plain command substitution and fail loudly with the function's own message. Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
1 parent 240d089 commit 0744cd7

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

tests/e2e/cli-matrix/rd-clone-vd-data-plane.sh

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,16 @@ fi
186186
rm -f "$err_file"
187187

188188
echo ">> [Bug 020 / A] clone replicas materialise + converge UpToDate"
189-
mapfile -t cli_nodes < <(wait_clone_replicas "$DST_CLI" 120)
189+
# NB: `mapfile < <(fn)` swallows fn's exit status, and indexing the
190+
# then-empty array under `set -u` aborted with the unhelpful
191+
# `cli_nodes[0]: unbound variable` (masking wait_clone_replicas'
192+
# diagnostic). Capture through a plain substitution so a timeout
193+
# fails loudly with the function's own message.
194+
cli_nodes_raw=$(wait_clone_replicas "$DST_CLI" 120) || {
195+
echo "FAIL (Bug 020 / A): clone $DST_CLI did not materialise its replicas" >&2
196+
exit 1
197+
}
198+
mapfile -t cli_nodes <<<"$cli_nodes_raw"
190199
wait_uptodate "$DST_CLI" "${cli_nodes[0]}" "${cli_nodes[1]}"
191200

192201
echo ">> [Bug 020 / A] marker bytes present on EVERY clone replica"
@@ -226,7 +235,11 @@ if [[ "$clone_status" != "COMPLETE" ]]; then
226235
fi
227236

228237
echo ">> [Bug 020 / B] clone replicas materialise + converge UpToDate"
229-
mapfile -t zfs_nodes < <(wait_clone_replicas "$DST_ZFS" 120)
238+
zfs_nodes_raw=$(wait_clone_replicas "$DST_ZFS" 120) || {
239+
echo "FAIL (Bug 020 / B): clone $DST_ZFS did not materialise its replicas" >&2
240+
exit 1
241+
}
242+
mapfile -t zfs_nodes <<<"$zfs_nodes_raw"
230243
wait_uptodate "$DST_ZFS" "${zfs_nodes[0]}" "${zfs_nodes[1]}"
231244

232245
echo ">> [Bug 020 / B] marker bytes present on EVERY clone replica"

0 commit comments

Comments
 (0)