Skip to content

FIX: bound ACA rollback connection wait by deadline instead of attempt count - #2913

Merged
hannahwestra25 merged 2 commits into
microsoft:mainfrom
hannahwestra25:hannahwestra25-fix-rollback-wait-deadline
Sep 30, 2026
Merged

hannahwestra25 merged 2 commits into
microsoft:mainfrom
hannahwestra25:hannahwestra25-fix-rollback-wait-deadline

Conversation

@hannahwestra25

@hannahwestra25 hannahwestra25 commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

rollback_public_origin polled for connection removal using for attempt in {1..20} with a fixed sleep 15. An attempt counter can't be compressed by the test's sleep stub, so test_cancellation_keeps_public_access_disabled_until_connection_removal ran all 20 iterations — each two forks plus a jq spawn — intermittently exceeding the harness's 30s timeout on Windows CI.

Now a SECONDS deadline, matching wait_for_http_health. Budget (300s) and poll interval (15s) unchanged. The test stub advances SECONDS, finishing in two polls.

Verified: tests/unit/infra 49 passed; new tests fail against the old loop (19 sleeps); 7.72s → 3.05s.

…t count

`rollback_public_origin` polled for private endpoint connection removal with
`for attempt in {1..20}` and a fixed `sleep 15`. An attempt-count loop does not
bound wall-clock time: each `az` call costs seconds of real CLI latency, so the
intended 5 minute window stretched well past it during a cutover rollback.

It also made the loop untestable. A no-op `sleep` stub cannot compress an
attempt counter, so `test_cancellation_keeps_public_access_disabled_until_
connection_removal` had to grind through all 20 iterations. Each one costs two
subshell forks plus a `jq` spawn, which is slow under Git Bash on Windows, and
the test intermittently exceeded the harness 30s subprocess timeout in CI.

Switch to a `SECONDS` deadline, matching `wait_for_http_health` in
deployment_common.sh, and log the remaining budget while waiting so a multi
minute wait is visible in pipeline logs. The retry budget and poll interval are
unchanged at 300s and 15s.

The test now stubs `sleep` to advance `SECONDS`, the same pattern the existing
HTTP readiness tests use, so the budget is exhausted in two polls. It asserts
the poll interval and that exactly one wait occurred, which pins the deadline
behavior; the old loop produces 19 sleeps and fails these assertions.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@hannahwestra25
hannahwestra25 added this pull request to the merge queue Sep 30, 2026
Merged via the queue into microsoft:main with commit 8934a3c Sep 30, 2026
42 checks passed
@hannahwestra25
hannahwestra25 deleted the hannahwestra25-fix-rollback-wait-deadline branch September 30, 2026 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants