Skip to content

[AI Generated] Fix inverted requirement in setspace mismatch skip messages - #4761

Open
SrikanthMyakam (SRIKKANTH) wants to merge 2 commits into
mainfrom
smyakam/fix_setspace_mismatch_msg/2026_10_10
Open

SrikanthMyakam (SRIKKANTH) wants to merge 2 commits into
mainfrom
smyakam/fix_setspace_mismatch_msg/2026_10_10

Conversation

@SRIKKANTH

@SRIKKANTH SrikanthMyakam (SRIKKANTH) commented Oct 10, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Fixes misleading deployment skip messages that state the opposite of the real requirement. Example: requires [not(Sriov)] but VM supports [Synthetic] when the test actually requires Sriov.

Root cause: check_setspace treats a requirement as "any of these items" and ignores is_allow_set. Its reason text, however, used SetSpace.__repr__, which prints any is_allow_set=False set as not(...). Merged requirements from intersect_setspace_by_priority (SetSpace[T]()) and the schema's default sets both have is_allow_set=False. For example, Sriov() merged with the default {Synthetic, Sriov} becomes {Sriov}, which was printed as not(Sriov).

Changes:

  • lisa/search_space.py: check_setspace now lists the items it actually checked. Matching behavior is unchanged, so no skip or pass decision changes.
  • lisa/sut_orchestrator/azure/platform_.py: when several locations (e.g. westus2 and westus3) report the same reason, it is shown once.
  • selftests/test_search_space.py: regression test covering a default-flag set, plain enum values, and the Sriov merge path.

Before / After:

Before After
Requirement mismatch: data_path: requires [not(Sriov)] but VM supports [Synthetic]; Requirement mismatch: data_path: requires [not(Sriov)] but VM supports [Synthetic] Requirement mismatch: data_path: requires [Sriov] but VM supports [Synthetic]
Requirement mismatch: disk_controller_type: requires [not(NVMe)] but VM supports [SCSI] Requirement mismatch: disk_controller_type: requires [NVMe] but VM supports [SCSI]

Affected tests include verify_sriov_*, stress_sriov_*, verify_hibernation_sriov_network*, verify_nvme_sriov_rescind, verify_xdp_*, stress_hibernation and verify_nvme_disk_controller_type.

intersect_setspace_by_priority is intentionally not changed to return an allow-set. That would change how SetSpace.check() evaluates the merged set, so it is out of scope for this message-only fix.

Related Issue

N/A - reported directly in this pull request.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Refactoring
  • Documentation update

Checklist

  • Description is filled in above
  • No credentials, secrets, or internal details are included
  • Peer review requested (if not, add required peer reviewers after raising PR)
  • Tests executed and results posted below

Test Validation

Key Test Cases:
verify_sriov_basic|verify_sriov_provision_with_max_nics|verify_hibernation_sriov_network|verify_nvme_sriov_rescind|verify_nvme_disk_controller_type|smoke_test

Impacted LISA Features:
NetworkInterface, Sriov, Synthetic, Disk, Nvme, Hibernation

Tested Azure Marketplace Images:

  • canonical ubuntu-24_04-lts server latest
  • canonical ubuntu-24_04-lts server-arm64 latest

Test Results

Image VM Size Result
N/A (unit tests) N/A python -m unittest selftests.test_search_space selftests.runners.test_lisa_runner: PASSED (31 tests)
N/A (repro) N/A intersect_setspace_by_priority(Sriov, {Synthetic, Sriov}) checked against [Synthetic] now gives data_path: requires [Sriov] but VM supports [Synthetic]: PASSED
canonical ubuntu-24_04-lts server latest not run Azure validation not run yet
canonical ubuntu-24_04-lts server-arm64 latest not run Azure validation not run yet

Lint: isort clean. mypy shows no new errors; 2 errors in test_countspace_check_rejection_reasons already exist on main.

check_setspace treats requirements as "any of these items" and ignores
is_allow_set. Its skip reason, however, used SetSpace.__repr__, which
prints any set with is_allow_set=False as "not(...)". Merged requirements
from intersect_setspace_by_priority, and the schema's default sets, have
is_allow_set=False. As a result, skip messages stated the opposite of the
real requirement.

The reason now lists the items that were actually checked. Matching
behavior is unchanged. When several locations report the same reason,
the Azure platform now shows it once.

Examples:

  Before: Requirement mismatch: data_path: requires [not(Sriov)] but VM
          supports [Synthetic]; Requirement mismatch: data_path: requires
          [not(Sriov)] but VM supports [Synthetic]
  After:  Requirement mismatch: data_path: requires [Sriov] but VM
          supports [Synthetic]

  Before: Requirement mismatch: disk_controller_type: requires [not(NVMe)]
          but VM supports [SCSI]
  After:  Requirement mismatch: disk_controller_type: requires [NVMe] but
          VM supports [SCSI]

This affects SRIOV tests (e.g. verify_sriov_basic,
verify_sriov_provision_with_max_nics, verify_hibernation_sriov_network,
verify_nvme_sriov_rescind) and verify_nvme_disk_controller_type.

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The logic is narrowly scoped and correct; only minor test and traceability follow-ups remain.

2 open findings
What changed in this PR

Fixes inverted SetSpace requirement messages and removes duplicate Azure location errors.

Changes:

  • Formats checked set items without misleading not(...).
  • Deduplicates identical Azure deployment errors.
  • Adds regression coverage for requirement formatting.
File Description
lisa/​search_space.py Corrects set-space mismatch formatting.
lisa/​sut_orchestrator/​azure/​platform_.py Deduplicates location errors.
selftests/​test_search_space.py Tests corrected mismatch reasons.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread lisa/search_space.py
Comment thread lisa/sut_orchestrator/azure/platform_.py
@LiliDeng

Copy link
Copy Markdown
Collaborator

AI Test Case Selection

Selected 1 test case(s): smoke_test

Marketplace image: canonical 0001-com-ubuntu-server-jammy 22_04-lts-gen2 latest

Result: Succeeded

View full logs in Azure DevOps

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 11, 2026 14:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The message-only fixes match existing evaluation behavior and have focused regression coverage.

Key Test Cases:
verify_sriov_basic|verify_nvme_disk_controller_type

Impacted LISA Features:
NetworkInterface, Disk, Nvme

Tested Azure Marketplace Images:

  • canonical ubuntu-24_04-lts server latest

0 open findings

2 resolved since last review

🧠 Review effort: Balanced

@LiliDeng

Copy link
Copy Markdown
Collaborator

AI Test Case Selection

Selected 1 test case(s): smoke_test

Marketplace image: canonical 0001-com-ubuntu-server-jammy 22_04-lts-gen2 latest

Result: Succeeded

View full logs in Azure DevOps

@LiliDeng LiliDeng changed the title Fix inverted requirement in setspace mismatch skip messages [AI Generated] Fix inverted requirement in setspace mismatch skip messages Oct 12, 2026

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants