Skip to content

Conversation

@DaanHoogland
Copy link
Contributor

@DaanHoogland DaanHoogland commented Oct 30, 2025

Description

This PR…
Fixes: #9026 , but shows that there is a genuine issue in the vlan allocation management in the system.

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • Build/CI
  • Test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

How did you try to break this feature and the system with this change?

@boring-cyborg boring-cyborg bot added component:integration-test Python Warning... Python code Ahead! labels Oct 30, 2025
@DaanHoogland DaanHoogland added this to the 4.20.3 milestone Oct 30, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the test cleanup mechanism in test_migration.py to leverage the parent class's cleanup functionality. The changes move from a custom cleanup implementation to using the standard super() pattern inherited from cloudstackTestCase.

Key changes:

  • Appending resources to cleanup lists immediately after creation instead of in bulk at the end
  • Delegating cleanup to parent class methods via super() calls
  • Initializing self.cleanup list at the beginning of setUp() method

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

zoneid=self.zone.id
)
self.cleanup.append(deployVmResponse)

Copy link

Copilot AI Oct 30, 2025

Choose a reason for hiding this comment

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

[nitpick] There's an extra blank line added after appending deployVmResponse to the cleanup list (line 215), but no blank line after other similar append operations (e.g., lines 194, 255, 271). For consistency, either remove this blank line or add blank lines after all similar operations throughout the file.

Suggested change

Copilot uses AI. Check for mistakes.
domainid=self.account.domainid
)
self.cleanup.append(vpc)

Copy link

Copilot AI Oct 30, 2025

Choose a reason for hiding this comment

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

[nitpick] Similar to the previous comment, there's an extra blank line after appending vpc to the cleanup list. This inconsistency in spacing should be addressed to maintain uniform code style throughout the file.

Suggested change

Copilot uses AI. Check for mistakes.
@codecov
Copy link

codecov bot commented Oct 30, 2025

Codecov Report

❌ Patch coverage is 10.00000% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 16.19%. Comparing base (e90e436) to head (1f8a09f).
⚠️ Report is 1 commits behind head on 4.20.

Files with missing lines Patch % Lines
...n/java/com/cloud/dc/dao/DataCenterVnetDaoImpl.java 0.00% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##               4.20   #11945   +/-   ##
=========================================
  Coverage     16.18%   16.19%           
- Complexity    13305    13307    +2     
=========================================
  Files          5657     5657           
  Lines        498466   498480   +14     
  Branches      60491    60494    +3     
=========================================
+ Hits          80696    80704    +8     
- Misses       408789   408795    +6     
  Partials       8981     8981           
Flag Coverage Δ
uitests 4.00% <ø> (ø)
unittests 17.04% <10.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@DaanHoogland
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@DaanHoogland a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 15594

Copy link
Member

@vishesh92 vishesh92 left a comment

Choose a reason for hiding this comment

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

clgtm

@DaanHoogland
Copy link
Contributor Author

unfortunately test-a-TestNetworkMigration-test_01_native_to_native_network_migration-###### is still created and destroyed but a vlan is still allocated to it.

@DaanHoogland
Copy link
Contributor Author

unfortunately test-a-TestNetworkMigration-test_01_native_to_native_network_migration-###### is still created and destroyed but a vlan is still allocated to it.

The problem seems to be not in the test but in vlan allocation leakage in the system. This can be merged but the left over from the test will remain, the scenario is valid.

@DaanHoogland
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@DaanHoogland a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 15619

@DaanHoogland
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@DaanHoogland a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

Copy link
Collaborator

@sudo87 sudo87 left a comment

Choose a reason for hiding this comment

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

clgtm

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 15621

@DaanHoogland DaanHoogland reopened this Nov 3, 2025
@DaanHoogland
Copy link
Contributor Author

@blueorangutan test

@blueorangutan
Copy link

@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

@DaanHoogland
Copy link
Contributor Author

DaanHoogland commented Nov 3, 2025

As this is purely (test)cleanup, I don’t think this needs further testing , agree @vishesh92 @sudo87 @Pearl1594 ?

@vishesh92
Copy link
Member

As this is purely (test)cleanup, I don’t think this needs further testing , agree @vishesh92 @sudo87 @Pearl1594 ?

Yes. Just need to wait for test results to ensure that teardown gets executed successfully.

@blueorangutan
Copy link

[SF] Trillian test result (tid-14767)
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 103997 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr11945-t14767-kvm-ol8.zip
Smoke tests completed. 116 look OK, 25 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_01_events_resource Error 454.05 test_events_resource.py
test_01_events_resource Error 454.09 test_events_resource.py
ContextSuite context=TestAccountAccess>:teardown Error 108.80 test_account_access.py
ContextSuite context=TestAddVmToSubDomain>:teardown Error 30.72 test_accounts.py
test_DeleteDomain Error 282.14 test_accounts.py
test_forceDeleteDomain Failure 423.04 test_accounts.py
test_forceDeleteDomain Error 423.05 test_accounts.py
ContextSuite context=TestNonRootAdminsPrivileges>:teardown Error 16.50 test_accounts.py
ContextSuite context=TestServiceOfferingHierarchy>:teardown Error 3.42 test_accounts.py
ContextSuite context=TestServiceOfferingSiblings>:teardown Error 3.39 test_accounts.py
ContextSuite context=TestTemplateHierarchy>:teardown Error 4.43 test_accounts.py
ContextSuite context=TestUserAPIKeys>:teardown Error 10.87 test_accounts.py
test_LoginApiDomain Error 8.32 test_accounts.py
test_01_create_list_domain_account_project Error 11.16 test_create_list_domain_account_project.py
ContextSuite context=TestIpv4Routing>:setup Error 0.00 test_ipv4_routing.py
test_deploy_more_vms_than_limit_allows Error 142.57 test_deploy_vms_in_parallel.py
ContextSuite context=TestDomainsDiskOfferings>:teardown Error 33.24 test_domain_disk_offerings.py
ContextSuite context=TestDomainsNetworkOfferings>:teardown Error 28.34 test_domain_network_offerings.py
ContextSuite context=TestDomainsServiceOfferings>:teardown Error 410.88 test_domain_service_offerings.py
ContextSuite context=TestDomainsVpcOfferings>:teardown Error 208.66 test_domain_vpc_offerings.py
test_01_disable_account_settings_for_domain Error 8.92 test_enable_account_settings_for_domain.py
test_02_enable_account_settings_for_domain Error 8.49 test_enable_account_settings_for_domain.py
test_03_enable_account_settings_for_domain Error 8.41 test_enable_account_settings_for_domain.py
ContextSuite context=TestHostControlState>:teardown Error 32.55 test_host_control_state.py
ContextSuite context=TestImportAndUnmanageVolumes>:teardown Error 26.91 test_import_unmanage_volumes.py
ContextSuite context=TestListAccounts>:teardown Error 4.66 test_list_accounts.py
test_04_list_domains_level_filter Failure 0.41 test_list_domains.py
test_05_list_domains_no_filter Failure 0.64 test_list_domains.py
ContextSuite context=TestListDomains>:teardown Error 4.02 test_list_domains.py
ContextSuite context=TestListVolumes>:teardown Error 17.12 test_list_volumes.py
ContextSuite context=TestNetworkPermissions>:teardown Error 18.59 test_network_permissions.py
ContextSuite context=TestNonStrictAffinityGroups>:teardown Error 188.99 test_nonstrict_affinity_group.py
ContextSuite context=TestCrossDomainAccountAdd>:teardown Error 6.83 test_projects.py
test_04_delete_domain_with_project Error 2.32 test_projects.py
ContextSuite context=TestPurgeExpungedVms>:teardown Error 423.00 test_purge_expunged_vms.py
ContextSuite context=TestRAMCPUResourceAccounting>:teardown Error 163.60 test_resource_accounting.py
ContextSuite context=TestVmAutoScaling>:teardown Error 673.21 test_vm_autoscaling.py
ContextSuite context=TestVnfTemplates>:teardown Error 10.53 test_vnf_templates.py
test_01_webhook_deliveries Error 10.00 test_webhook_delivery.py
test_04_create_webhook_domainadmin_local Error 8.00 test_webhook_lifecycle.py
test_05_create_webhook_domainadmin_subdomain Error 9.23 test_webhook_lifecycle.py
test_06_create_webhook_domainadmin_global_negative Error 7.68 test_webhook_lifecycle.py
test_07_create_webhook_user_local Error 7.32 test_webhook_lifecycle.py
test_08_create_webhook_user_domain Error 7.63 test_webhook_lifecycle.py
test_09_create_webhook_user_gloabl Error 7.43 test_webhook_lifecycle.py
test_10_create_webhook_admin_advanced Error 7.33 test_webhook_lifecycle.py
test_11_update_webhook Error 7.61 test_webhook_lifecycle.py
test_12_list_user_webhook_deliveries Error 12.48 test_webhook_lifecycle.py
test_13_webhook_execute_delivery Error 7.79 test_webhook_lifecycle.py

@DaanHoogland DaanHoogland reopened this Nov 5, 2025
@DaanHoogland
Copy link
Contributor Author

[SF] Trillian test result (tid-14767) Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8 Total time taken: 103997 seconds Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr11945-t14767-kvm-ol8.zip Smoke tests completed. 116 look OK, 25 have errors, 0 did not run Only failed and skipped tests results shown below:

I don’t think there is much relevance in this, rerunning.

@blueorangutan
Copy link

[SF] Trillian test result (tid-14772)
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 94256 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr11945-t14772-kvm-ol8.zip
Smoke tests completed. 116 look OK, 25 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_01_events_resource Error 427.29 test_events_resource.py
test_01_events_resource Error 427.31 test_events_resource.py
ContextSuite context=TestAccountAccess>:teardown Error 70.18 test_account_access.py
ContextSuite context=TestAddVmToSubDomain>:teardown Error 32.95 test_accounts.py
test_DeleteDomain Error 214.35 test_accounts.py
test_forceDeleteDomain Failure 395.14 test_accounts.py
test_forceDeleteDomain Error 395.15 test_accounts.py
ContextSuite context=TestNonRootAdminsPrivileges>:teardown Error 11.04 test_accounts.py
ContextSuite context=TestServiceOfferingHierarchy>:teardown Error 3.23 test_accounts.py
ContextSuite context=TestServiceOfferingSiblings>:teardown Error 3.23 test_accounts.py
ContextSuite context=TestTemplateHierarchy>:teardown Error 4.40 test_accounts.py
ContextSuite context=TestUserAPIKeys>:teardown Error 6.87 test_accounts.py
test_LoginApiDomain Error 5.48 test_accounts.py
test_01_create_list_domain_account_project Error 7.83 test_create_list_domain_account_project.py
ContextSuite context=TestIpv4Routing>:setup Error 0.00 test_ipv4_routing.py
test_deploy_more_vms_than_limit_allows Error 119.48 test_deploy_vms_in_parallel.py
ContextSuite context=TestDomainsDiskOfferings>:teardown Error 18.39 test_domain_disk_offerings.py
ContextSuite context=TestDomainsNetworkOfferings>:teardown Error 15.83 test_domain_network_offerings.py
ContextSuite context=TestDomainsServiceOfferings>:teardown Error 324.06 test_domain_service_offerings.py
ContextSuite context=TestDomainsVpcOfferings>:teardown Error 153.72 test_domain_vpc_offerings.py
test_01_disable_account_settings_for_domain Error 5.57 test_enable_account_settings_for_domain.py
test_02_enable_account_settings_for_domain Error 5.33 test_enable_account_settings_for_domain.py
test_03_enable_account_settings_for_domain Error 5.47 test_enable_account_settings_for_domain.py
ContextSuite context=TestHostControlState>:teardown Error 37.19 test_host_control_state.py
ContextSuite context=TestImportAndUnmanageVolumes>:teardown Error 24.67 test_import_unmanage_volumes.py
ContextSuite context=TestListAccounts>:teardown Error 4.28 test_list_accounts.py
test_04_list_domains_level_filter Failure 0.12 test_list_domains.py
test_05_list_domains_no_filter Failure 0.12 test_list_domains.py
ContextSuite context=TestListDomains>:teardown Error 3.33 test_list_domains.py
ContextSuite context=TestListVolumes>:teardown Error 15.56 test_list_volumes.py
ContextSuite context=TestNetworkPermissions>:teardown Error 18.19 test_network_permissions.py
ContextSuite context=TestNonStrictAffinityGroups>:teardown Error 208.93 test_nonstrict_affinity_group.py
ContextSuite context=TestCrossDomainAccountAdd>:teardown Error 6.42 test_projects.py
test_04_delete_domain_with_project Error 2.21 test_projects.py
ContextSuite context=TestPurgeExpungedVms>:teardown Error 387.36 test_purge_expunged_vms.py
ContextSuite context=TestRAMCPUResourceAccounting>:teardown Error 138.40 test_resource_accounting.py
ContextSuite context=TestVmAutoScaling>:teardown Error 641.16 test_vm_autoscaling.py
ContextSuite context=TestVnfTemplates>:teardown Error 8.53 test_vnf_templates.py
test_01_webhook_deliveries Error 7.14 test_webhook_delivery.py
test_04_create_webhook_domainadmin_local Error 6.19 test_webhook_lifecycle.py
test_05_create_webhook_domainadmin_subdomain Error 7.24 test_webhook_lifecycle.py
test_06_create_webhook_domainadmin_global_negative Error 4.60 test_webhook_lifecycle.py
test_07_create_webhook_user_local Error 4.97 test_webhook_lifecycle.py
test_08_create_webhook_user_domain Error 4.79 test_webhook_lifecycle.py
test_09_create_webhook_user_gloabl Error 4.80 test_webhook_lifecycle.py
test_10_create_webhook_admin_advanced Error 4.83 test_webhook_lifecycle.py
test_11_update_webhook Error 4.99 test_webhook_lifecycle.py
test_12_list_user_webhook_deliveries Error 10.08 test_webhook_lifecycle.py
test_13_webhook_execute_delivery Error 5.36 test_webhook_lifecycle.py

@DaanHoogland DaanHoogland marked this pull request as draft November 6, 2025 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component:integration-test Python Warning... Python code Ahead!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

after TestNetworkMigration a vlan is still allocated to a deleted network

4 participants