Skip to content

tests: expect warning on azure pro images. avoid client.destroy#6872

Draft
blackboxsw wants to merge 1 commit into
canonical:mainfrom
blackboxsw:azure-allow-one-IMDS-retry
Draft

tests: expect warning on azure pro images. avoid client.destroy#6872
blackboxsw wants to merge 1 commit into
canonical:mainfrom
blackboxsw:azure-allow-one-IMDS-retry

Conversation

@blackboxsw
Copy link
Copy Markdown
Collaborator

@blackboxsw blackboxsw commented May 8, 2026

Fix integration test errors seen on Azure UbuntuPro testing seen during SRU review of 26.1.

  1. Ignore intermittent warning about single retry seen on some Azure Pro images during first attempt to contact IMDS during first boot. This issue seems to occur most frequently on Azure marketplace Pro images but may not be limited to Pro images.

  2. Avoid client.destroy when our integration test is within cloud_session.launch context manager because that tear down is performed by the context manager.

Proposed Commit Message

tests: expect intermittent warning accessing Azure IMDS. Avoid client.destroy

Avoid client.destroy within the cloud_session.launch context manager
as it already performs cloud.destroy on context exit which calls
instance.destroy. This avoids the following error seen by pycloudlib
on Azure instances:

  <pycloudlib.azure.instance.AzureInstance object at ....
    
  @property
  def id(self):
      """Return instance id."""
      return self._instance["vm"].id
               ^^^^^^^^^^^^^^^^^^^^
      TypeError: 'NoneType' object is not subscriptable

Additionally, some Azure instance launches encounter intemittent
warning reaching IMDS on first attempt. Avoid failing integration
tests when encountering a single warning about IMDS access.

If multiple retries are required to reach Azure IMDS, treat this as
an error.

Additional Context

Test Steps

Merge type

  • Squash merge using "Proposed Commit Message"
  • Rebase and merge unique commits. Requires commit messages per-commit each referencing the pull request number (#<PR_NUM>)

@blackboxsw blackboxsw requested a review from holmanb May 8, 2026 00:53
@blackboxsw blackboxsw marked this pull request as draft May 8, 2026 04:15
@holmanb
Copy link
Copy Markdown
Member

holmanb commented May 8, 2026

GitHub can't show me the files currently, but from the description I don't see how this is a pro-specific issue. Can you please elaborate?

….destroy

Avoid client.destroy within the cloud_session.launch context manager
as it already performs cloud.destroy on context exit which calls
instance.destroy. This avoids the following error seen by pycloudlib
on Azure instances:

  <pycloudlib.azure.instance.AzureInstance object at ....

  @Property
  def id(self):
      """Return instance id."""
      return self._instance["vm"].id
               ^^^^^^^^^^^^^^^^^^^^
      TypeError: 'NoneType' object is not subscriptable

Additionally, some Azure instance launches encounter intemittent
warning reaching IMDS on first attempt. Avoid failing integration
tests when encountering a single warning about IMDS access.

If multiple retries are required to reach Azure IMDS, treat this as
an error.
@blackboxsw blackboxsw force-pushed the azure-allow-one-IMDS-retry branch from ad428d1 to c407dc4 Compare May 21, 2026 16:34
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.

2 participants