Skip to content

[AKS] Stabilize live tests and preserve IPv4 outbound default - #33886

Draft
FumingZhang wants to merge 8 commits into
Azure:devfrom
FumingZhang:fix/aks-live-test-remaining-failures
Draft

[AKS] Stabilize live tests and preserve IPv4 outbound default#33886
FumingZhang wants to merge 8 commits into
Azure:devfrom
FumingZhang:fix/aks-live-test-remaining-failures

Conversation

@FumingZhang

@FumingZhang FumingZhang commented Aug 13, 2026

Copy link
Copy Markdown
Member

🤖 PR Validation — ️✔️ All clear

Breaking Changes Tests
️✔️ None ️✔️ 130/130

Related command

az aks create, az aks update, az aks nodepool add, az aks nodepool update, az aks nodepool auto-scale

Description

This PR fixes actionable failures from the AKS CLI live-test runner and restores the historical managed outbound IPv4 default.

  • Preserve the default managedOutboundIPs.count=1 when only IPv6 is supplied, without overriding explicit or existing IPv4 values.
  • Harden provisioning retries, cluster settle waits, and retry-enabled recording cleanup.
  • Use dedicated Log Analytics and Azure Monitor workspaces to avoid shared-workspace provisioning races.
  • Fix Automatic SKU identity setup, monitoring workspace assertions, and Control Plane Metrics rollout handling.
  • Use a supported region and VM size for capacity-sensitive migration and Artifact Streaming scenarios.
  • Allow the network-isolated node-image rollout its observed 90-minute completion window.
  • Keep unsupported-feature skipping narrowly scoped to Control Plane Metrics so unrelated failures still surface.

Testing Guide

  • python -m pytest -q test_aks_provisioning_retry.py test_loadbalancer.py — 43 passed, 5 subtests passed.
  • Full ACS validation for the earlier live-test stability changes — 980 passed, 84 skipped, 4 subtests passed.
  • Dual-stack scenario replay — passed.
  • python -m py_compile for changed Python files — passed.
  • git diff --check — passed.

History Notes

[AKS] az aks create, az aks update: Preserve the default managed outbound IPv4 count when only the IPv6 count is provided


This checklist is used to make sure that common guidelines for a pull request are followed.

FumingZhang and others added 4 commits August 6, 2026 03:42
Avoid retry formatting of inline JSON, initialize Container Insights workspaces before AKS creation, wait between sequential VMS pool operations, and skip live scenarios whose service toggles are unavailable in the runner subscription.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Artifact Streaming is GA and Control Plane Metrics is on the GA rollout path, so retain their live coverage instead of masking API-version and toggle-rollout failures.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Gate the VMS autoscaler settle checks to live and recording runs so existing replay cassettes do not issue unrecorded GET requests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Preserve the historical IPv4 managed outbound IP default when only the IPv6 count is supplied. Keep explicit and existing IPv4 values unchanged, and cover create and update behavior with focused tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).

Retry polling and refetch requests cannot replay through the normal scenario path. Disable recording for these live runs and discard any temporary cassette traffic captured while preparers override the recording flag.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).

FumingZhang and others added 3 commits August 14, 2026 04:59
Pulls in upstream fixes (including AKS rollback warning and CLI Runner
test stabilization) with no conflicts against the live-test stability
work in this branch.
Addresses 9 AKS live-test failures reported from core AKS live runner
run 0cb53881, following the established patterns already used in this
branch (dedicated workspace pre-creation, settle waits, precise
skip/gating, proven-good VM sizes/regions):

- test_aks_automatic_sku: be explicit about --enable-managed-identity
  on the Automatic-SKU create command instead of relying on implicit
  client-side backfill, since Automatic + RP-managed VNet requires a
  System-Assigned Managed Identity.
- test_aks_create_acns_with_flow_logs: pre-create a dedicated Log
  Analytics workspace (via --workspace-resource-id) instead of the
  RP's shared default workspace, and add a settle wait after create
  so the Microsoft-ContainerNetworkLogs custom table finishes
  provisioning before toggling container network logs (avoids the
  InvalidOutputTable race).
- test_aks_create_default_service_with_monitoring_addon_msi: fix the
  stale post-create assertion that still expected the RP's
  DefaultResourceGroup/DefaultWorkspace naming even though the test
  now creates its own dedicated workspace; assert against the actual
  workspace id instead.
- test_aks_create_with_azuremonitormetrics /
  test_aks_update_with_azuremonitormetrics /
  test_aks_create_with_control_plane_metrics /
  test_aks_update_with_control_plane_metrics: add a
  _create_azure_monitor_workspace helper (mirrors
  _create_container_insights_workspace) and pass a dedicated, per-test
  Azure Monitor Workspace id via --azure-monitor-workspace-resource-id
  instead of letting all of these westus2 tests race on the RP's
  single shared default AMW ("already exists"/state-collision).
- test_aks_create_with_control_plane_metrics /
  test_aks_update_with_control_plane_metrics: add a narrow
  _cmd_or_skip_if_unsupported helper that skips (rather than fails)
  only when the service reports the Control Plane Metrics
  toggle/feature itself as unsupported, since its rollout is still in
  progress; any other failure still fails the test loudly.
- test_aks_kubenet_to_cni_overlay_migration: move from eastus2 (known
  AKSCapacityHeavyUsage errors) to eastus, matching neighboring
  network-plugin migration tests in this file; update the checked-in
  VCR recording's region strings to match so replay-mode CI keeps
  passing.
- test_aks_nodepool_add_with_artifact_streaming: pin --node-vm-size to
  the already-proven Standard_D2s_v3 (used across dozens of other
  tests in this suite) instead of relying on the RP's default VM size,
  which can hit "VM sizes not allowed" quota/allow-list errors.
- test_aks_network_isolated_cluster: raise the post-node-image-upgrade
  nodepool wait timeout from 3600s to 5400s, since cache-based
  bootstrap on a network-isolated/private cluster adds real extra
  latency to the node image rollout.

No custom AKS feature-gate header strings were invented; only headers
already used elsewhere in this test file are reused (e.g.
AzureOverlayPreview). Neither the SAMI requirement nor Control Plane
Metrics has an associated preview header anywhere in the codebase, so
none was added.

Adds focused unit tests in test_aks_provisioning_retry.py for the two
new helpers (_create_azure_monitor_workspace,
_cmd_or_skip_if_unsupported), covering the happy path, the
skip-on-known-marker path, and the re-raise-on-unrelated-error path.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Address review feedback on _cmd_or_skip_if_unsupported: the previous
marker set (e.g. "is not supported", "unsupported") was broad enough
that an unrelated failure containing the same generic phrasing (for
example an invalid/unsupported VM size or SKU) could be mistaken for
Control Plane Metrics being unavailable and incorrectly skipped
instead of failing loudly.

Split the marker set into two independent groups that must BOTH match
before a skip is allowed:
- _CONTROL_PLANE_METRICS_CONTEXT_MARKERS: substrings confirming the
  failure text is actually about the Control Plane Metrics feature.
- _UNSUPPORTED_CONDITION_MARKERS: substrings confirming the failure is
  an availability/support condition (renamed from the old, single
  _FEATURE_TOGGLE_UNAVAILABLE_MARKERS).

_cmd_or_skip_if_unsupported now only skips when the caught error text
contains at least one marker from each group; any other failure
(including one that only matches the generic condition markers)
re-raises unchanged. Both marker groups are still overridable via
optional context_markers/condition_markers parameters if a future
caller needs a different feature-specific context.

Added two negative unit tests proving unrelated "not supported"
failures are re-raised rather than skipped: one with an unrelated but
recognizable resource-type context (VMSizeNotSupported), and one with
no feature-specific context at all.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).

@yonzhan

Copy link
Copy Markdown
Collaborator

AKS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

act-observability-squad AKS az aks/acs/openshift Auto-Assign Auto assign by bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants