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.18%. Comparing base (028dd86) to head (74235ec).

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.18%   -0.01%     
- Complexity    13298    13299       +1     
============================================
  Files          5657     5657              
  Lines        498470   498480      +10     
  Branches      60493    60493              
============================================
- Hits          80660    80658       -2     
- Misses       408830   408842      +12     
  Partials       8980     8980              
Flag Coverage Δ
uitests 4.00% <ø> (ø)
unittests 17.03% <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.

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.

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

@DaanHoogland DaanHoogland reopened this Nov 3, 2025
@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.

@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.

@DaanHoogland DaanHoogland marked this pull request as draft November 6, 2025 12:04
@DaanHoogland DaanHoogland force-pushed the ghi9026-testNetworkMigrationCleanup branch from a080eb8 to 74235ec Compare November 13, 2025 15:26
@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 15755

@apache apache deleted a comment from blueorangutan Nov 13, 2025
@apache apache deleted a comment from blueorangutan Nov 13, 2025
@apache apache deleted a comment from blueorangutan Nov 13, 2025
@apache apache deleted a comment from blueorangutan Nov 13, 2025
@apache apache deleted a comment from blueorangutan Nov 13, 2025
@apache apache deleted a comment from blueorangutan Nov 13, 2025
@apache apache deleted a comment from blueorangutan Nov 13, 2025
@apache apache deleted a comment from blueorangutan Nov 13, 2025
@apache apache deleted a comment from blueorangutan Nov 13, 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

@blueorangutan
Copy link

[SF] Trillian test result (tid-14828)
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 93476 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr11945-t14828-kvm-ol8.zip
Smoke tests completed. 115 look OK, 26 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 423.88 test_events_resource.py
test_01_events_resource Error 423.90 test_events_resource.py
ContextSuite context=TestAccountAccess>:teardown Error 68.85 test_account_access.py
ContextSuite context=TestAddVmToSubDomain>:teardown Error 32.90 test_accounts.py
test_DeleteDomain Error 204.10 test_accounts.py
test_forceDeleteDomain Failure 372.29 test_accounts.py
test_forceDeleteDomain Error 372.30 test_accounts.py
ContextSuite context=TestNonRootAdminsPrivileges>:teardown Error 11.51 test_accounts.py
ContextSuite context=TestServiceOfferingHierarchy>:teardown Error 3.22 test_accounts.py
ContextSuite context=TestServiceOfferingSiblings>:teardown Error 2.20 test_accounts.py
ContextSuite context=TestTemplateHierarchy>:teardown Error 4.29 test_accounts.py
ContextSuite context=TestUserAPIKeys>:teardown Error 6.12 test_accounts.py
test_LoginApiDomain Error 6.02 test_accounts.py
test_01_create_list_domain_account_project Error 8.12 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 111.47 test_deploy_vms_in_parallel.py
ContextSuite context=TestDomainsDiskOfferings>:teardown Error 18.93 test_domain_disk_offerings.py
ContextSuite context=TestDomainsNetworkOfferings>:teardown Error 16.50 test_domain_network_offerings.py
ContextSuite context=TestDomainsServiceOfferings>:teardown Error 371.53 test_domain_service_offerings.py
ContextSuite context=TestDomainsVpcOfferings>:teardown Error 169.66 test_domain_vpc_offerings.py
test_01_disable_account_settings_for_domain Error 4.47 test_enable_account_settings_for_domain.py
test_02_enable_account_settings_for_domain Error 5.40 test_enable_account_settings_for_domain.py
test_03_enable_account_settings_for_domain Error 5.03 test_enable_account_settings_for_domain.py
ContextSuite context=TestHostControlState>:teardown Error 34.14 test_host_control_state.py
ContextSuite context=TestImportAndUnmanageVolumes>:teardown Error 24.45 test_import_unmanage_volumes.py
ContextSuite context=TestListAccounts>:teardown Error 4.21 test_list_accounts.py
test_04_list_domains_level_filter Failure 0.13 test_list_domains.py
test_05_list_domains_no_filter Failure 0.18 test_list_domains.py
ContextSuite context=TestListDomains>:teardown Error 3.38 test_list_domains.py
ContextSuite context=TestListVolumes>:teardown Error 15.51 test_list_volumes.py
ContextSuite context=TestNetworkPermissions>:teardown Error 12.80 test_network_permissions.py
test_01_deployVMInSharedNetwork Failure 436.13 test_network.py
ContextSuite context=TestNonStrictAffinityGroups>:teardown Error 171.29 test_nonstrict_affinity_group.py
ContextSuite context=TestCrossDomainAccountAdd>:teardown Error 6.44 test_projects.py
test_04_delete_domain_with_project Error 2.17 test_projects.py
ContextSuite context=TestPurgeExpungedVms>:teardown Error 377.33 test_purge_expunged_vms.py
ContextSuite context=TestRAMCPUResourceAccounting>:teardown Error 136.40 test_resource_accounting.py
ContextSuite context=TestVmAutoScaling>:teardown Error 640.81 test_vm_autoscaling.py
ContextSuite context=TestVnfTemplates>:teardown Error 7.38 test_vnf_templates.py
test_01_webhook_deliveries Error 7.55 test_webhook_delivery.py
test_04_create_webhook_domainadmin_local Error 5.53 test_webhook_lifecycle.py
test_05_create_webhook_domainadmin_subdomain Error 6.67 test_webhook_lifecycle.py
test_06_create_webhook_domainadmin_global_negative Error 5.44 test_webhook_lifecycle.py
test_07_create_webhook_user_local Error 5.10 test_webhook_lifecycle.py
test_08_create_webhook_user_domain Error 5.67 test_webhook_lifecycle.py
test_09_create_webhook_user_gloabl Error 5.82 test_webhook_lifecycle.py
test_10_create_webhook_admin_advanced Error 5.53 test_webhook_lifecycle.py
test_11_update_webhook Error 5.58 test_webhook_lifecycle.py
test_12_list_user_webhook_deliveries Error 10.56 test_webhook_lifecycle.py
test_13_webhook_execute_delivery Error 5.85 test_webhook_lifecycle.py

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