Skip to content

Commit bae2dd0

Browse files
committed
test: retry ambiguous setup response
1 parent 2b7c975 commit bae2dd0

1 file changed

Lines changed: 25 additions & 1 deletion

File tree

scripts/ci/ordinary-server-upgrade-e2e.sh

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ plan_setup() {
244244
server-agent setup --request "$INPUTS/server-setup.json"
245245
}
246246

247-
apply_setup() {
247+
apply_setup_once() {
248248
local prefix="$1"
249249
local digest="$2"
250250
local output="$3"
@@ -257,6 +257,30 @@ apply_setup() {
257257
--expected-request-digest "$digest" --apply --start
258258
}
259259

260+
apply_setup() {
261+
local prefix="$1"
262+
local digest="$2"
263+
local output="$3"
264+
local exit_code=0
265+
apply_setup_once "$prefix" "$digest" "$output" || exit_code=$?
266+
if [[ "$exit_code" -eq 0 ]]; then
267+
return 0
268+
fi
269+
if ! jq -e '.status == "blocked" and .blocker == "systemd_start"' "$output" >/dev/null; then
270+
return "$exit_code"
271+
fi
272+
273+
# Public 0.1.50 can lose the systemctl response on a cold runner while the
274+
# exact units still converge. Its documented recovery is a same-digest
275+
# resume; retain the first response and prove that path rather than treating
276+
# ambiguous transport status as a terminal setup failure.
277+
mv "$output" "$output.systemd-response-loss"
278+
if [[ -e "$output.stderr" ]]; then
279+
mv "$output.stderr" "$output.systemd-response-loss.stderr"
280+
fi
281+
apply_setup_once "$prefix" "$digest" "$output"
282+
}
283+
260284
psql_agentnet() {
261285
sudo -u agentnet psql -X -Atq --dbname=agentnet "$@"
262286
}

0 commit comments

Comments
 (0)