From 1318cd48a149666ea5193306a79d184e0f210803 Mon Sep 17 00:00:00 2001 From: Balazs Gibizer Date: Mon, 30 Jun 2025 16:50:29 +0200 Subject: [PATCH] [test]RPC using threading or eventlet selectively The nova test hardcoded to run the RPC servers in the test with eventlet executor. We change that to be dynamic based on how the tests was started it can use eventlet or threading. This makes some of the so far hanging RPC dependent unit tests passing. Change-Id: I5012122fe66d41459b68202e750391a1939d70d9 Signed-off-by: Balazs Gibizer --- nova/tests/fixtures/nova.py | 3 +- threading_unit_test_excludes.txt | 69 +++++++++----------------------- 2 files changed, 22 insertions(+), 50 deletions(-) diff --git a/nova/tests/fixtures/nova.py b/nova/tests/fixtures/nova.py index dbf3dc3783e5..91b7cf4132c2 100644 --- a/nova/tests/fixtures/nova.py +++ b/nova/tests/fixtures/nova.py @@ -560,10 +560,11 @@ class CellDatabases(fixtures.Fixture): def _wrap_get_server(self, target, endpoints, serializer=None): """Mirror rpc.get_server() but with our special sauce.""" serializer = CheatingSerializer(serializer) + exc = "threading" if utils.concurrency_mode_threading() else "eventlet" return messaging.get_rpc_server(rpc.TRANSPORT, target, endpoints, - executor='eventlet', + executor=exc, serializer=serializer) def _wrap_get_client(self, target, version_cap=None, serializer=None, diff --git a/threading_unit_test_excludes.txt b/threading_unit_test_excludes.txt index 83f2b6d082fa..e9fcebd58f7a 100644 --- a/threading_unit_test_excludes.txt +++ b/threading_unit_test_excludes.txt @@ -1,45 +1,6 @@ -nova.tests.unit.api.openstack.compute.test_availability_zone.ServersControllerCreateTestV21.test_create_instance_with_availability_zone -nova.tests.unit.api.openstack.compute.test_services.ServicesTestV253.test_update_disabled_no_reason_then_enable -nova.tests.unit.compute.test_shelve.ShelveComputeAPITestCase.test_unshelve_with_az_to_newaz -nova.tests.unit.compute.test_shelve.ShelveComputeAPITestCase.test_unshelve_without_az_to_newaz_and_host -nova.tests.unit.compute.test_shelve.ShelveComputeAPITestCase.test_unshelve_without_az_to_newaz -nova.tests.unit.conductor.test_conductor.ConductorTaskAPITestCase.test_build_instances -nova.tests.unit.conductor.test_conductor.ConductorTaskAPITestCase.test_build_instances_arq_failure -nova.tests.unit.conductor.test_conductor.ConductorTaskAPITestCase.test_build_instances_destroy_build_request -nova.tests.unit.conductor.test_conductor.ConductorTaskAPITestCase.test_build_instances_exhaust_host_list -nova.tests.unit.conductor.test_conductor.ConductorTaskAPITestCase.test_build_instances_logs_selected_and_alts -nova.tests.unit.conductor.test_conductor.ConductorTaskAPITestCase.test_build_instances_no_host_mapping -nova.tests.unit.conductor.test_conductor.ConductorTaskAPITestCase.test_build_instances_reschedule_ignores_build_request -nova.tests.unit.conductor.test_conductor.ConductorTaskAPITestCase.test_build_instances_reschedule_not_recalc_mapping_if_claim_fails -nova.tests.unit.conductor.test_conductor.ConductorTaskAPITestCase.test_build_instances_reschedule_recalculates_provider_mapping -nova.tests.unit.conductor.test_conductor.ConductorTaskAPITestCase.test_build_instances_retry_exceeded -nova.tests.unit.conductor.test_conductor.ConductorTaskAPITestCase.test_build_instances_scheduler_failure -nova.tests.unit.conductor.test_conductor.ConductorTaskAPITestCase.test_build_instances_scheduler_group_failure -nova.tests.unit.conductor.test_conductor.ConductorTaskAPITestCase.test_build_instances_update_instance_mapping -nova.tests.unit.conductor.test_conductor.ConductorTaskAPITestCase.test_cold_migrate -nova.tests.unit.conductor.test_conductor.ConductorTaskAPITestCase.test_cold_migrate_forced_shutdown -nova.tests.unit.conductor.test_conductor.ConductorTaskAPITestCase.test_rebuild_instance_with_scheduler_group_failure -nova.tests.unit.conductor.test_conductor.ConductorTaskAPITestCase.test_unshelve_offload_instance_on_host_with_request_spec -nova.tests.unit.conductor.test_conductor.ConductorTaskRPCAPITestCase.test_build_instances -nova.tests.unit.conductor.test_conductor.ConductorTaskRPCAPITestCase.test_build_instances_arq_failure -nova.tests.unit.conductor.test_conductor.ConductorTaskRPCAPITestCase.test_build_instances_exhaust_host_list -nova.tests.unit.conductor.test_conductor.ConductorTaskRPCAPITestCase.test_build_instances_no_host_mapping -nova.tests.unit.conductor.test_conductor.ConductorTaskRPCAPITestCase.test_build_instances_reschedule_not_recalc_mapping_if_claim_fails -nova.tests.unit.conductor.test_conductor.ConductorTaskRPCAPITestCase.test_build_instances_scheduler_failure -nova.tests.unit.conductor.test_conductor.ConductorTaskRPCAPITestCase.test_cold_migrate -nova.tests.unit.conductor.test_conductor.ConductorTaskRPCAPITestCase.test_rebuild_instance_with_scheduler_group_failure -nova.tests.unit.conductor.test_conductor.ConductorTaskRPCAPITestCase.test_unshelve_offload_instance_on_host_with_request_spec nova.tests.unit.console.rfb.test_authvencrypt.RFBAuthSchemeVeNCryptTestCase.test_security_handshake_fails_on_ssl_failure nova.tests.unit.console.rfb.test_authvencrypt.RFBAuthSchemeVeNCryptTestCase.test_security_handshake_without_x509 nova.tests.unit.console.rfb.test_authvencrypt.RFBAuthSchemeVeNCryptTestCase.test_security_handshake_with_x509 -nova.tests.unit.objects.test_objects.TestObjectSerializer.test_object_tree_backport -nova.tests.unit.policies.test_availability_zone.AvailabilityZoneNoLegacyNoScopePolicyTest.test_availability_zone_detail_policy -nova.tests.unit.policies.test_availability_zone.AvailabilityZoneNoLegacyNoScopePolicyTest.test_availability_zone_list_policy -nova.tests.unit.policies.test_availability_zone.AvailabilityZonePolicyTest.test_availability_zone_detail_policy -nova.tests.unit.policies.test_availability_zone.AvailabilityZonePolicyTest.test_availability_zone_list_policy -nova.tests.unit.policies.test_availability_zone.AvailabilityZoneScopeTypePolicyTest.test_availability_zone_detail_policy -nova.tests.unit.policies.test_availability_zone.AvailabilityZoneScopeTypePolicyTest.test_availability_zone_list_policy -nova.tests.unit.policies.test_availability_zone.AZScopeTypeNoLegacyPolicyTest.test_availability_zone_list_policy nova.tests.unit.storage.test_rbd.RbdTestCase.test_cleanup_volumes nova.tests.unit.storage.test_rbd.RbdTestCase.test_cleanup_volumes_fail_not_found nova.tests.unit.storage.test_rbd.RbdTestCase.test_cleanup_volumes_fail_other @@ -47,14 +8,7 @@ nova.tests.unit.storage.test_rbd.RbdTestCase.test_cleanup_volumes_fail_snapshots nova.tests.unit.storage.test_rbd.RbdTestCase.test_cleanup_volumes_pending_resize nova.tests.unit.storage.test_rbd.RbdTestCase.test_cleanup_volumes_reverting_resize nova.tests.unit.storage.test_rbd.RbdTestCase.test_destroy_volume -nova.tests.unit.test_availability_zones.AvailabilityZoneTestCases.test_get_availability_zones -nova.tests.unit.test_baserpc.BaseAPITestCase.test_get_backdoor_port -nova.tests.unit.test_baserpc.BaseAPITestCase.test_ping nova.tests.unit.test_context.ContextTestCase.test_scatter_gather_cells_queued_task_cancelled -nova.tests.unit.test_rpc.TestRPC.test_get_server -nova.tests.unit.test_rpc.TestRPC.test_get_server_profiler_enabled -nova.tests.unit.test_utils.ExecutorStatsTestCase.test_stats_logged_eventlet -nova.tests.unit.test_utils.OsloServiceBackendSelectionTestCase.test_eventlet_selected nova.tests.unit.virt.libvirt.test_driver.CacheConcurrencyTestCase.test_different_fname_concurrency nova.tests.unit.virt.libvirt.test_driver.CacheConcurrencyTestCase.test_same_fname_concurrency nova.tests.unit.virt.libvirt.test_driver.LibvirtDriverTestCase.test_rescue @@ -118,6 +72,23 @@ nova.tests.unit.virt.vmwareapi.test_vm_util.VMwareVMUtilTestCase.test_create_vm_ # - sqlite3.OperationalError: cannot start a transaction within a transaction # both triggered at: nova.compute.api.HostAPI._service_get_all_cells nova.tests.unit.policies.test_availability_zone.AZScopeTypeNoLegacyPolicyTest.test_availability_zone_detail_policy -# Independent hang 100% -# after 160 seconds the test passes :/ -nova.tests.unit.conductor.test_conductor.ConductorTaskRPCAPITestCase.test_evacuate_old_rpc_without_target_state +nova.tests.unit.test_availability_zones.AvailabilityZoneTestCases.test_get_availability_zones +nova.tests.unit.policies.test_availability_zone.AZScopeTypeNoLegacyPolicyTest.test_availability_zone_list_policy +nova.tests.unit.policies.test_availability_zone.AvailabilityZone +nova.tests.unit.compute.test_shelve.ShelveComputeAPITestCase.test_unshelve_without_az_to_newaz_and_host +nova.tests.unit.compute.test_shelve.ShelveComputeAPITestCase.test_unshelve_without_az_to_newaz +nova.tests.unit.compute.test_shelve.ShelveComputeAPITestCase.test_unshelve_with_az_to_newaz +nova.tests.unit.api.openstack.compute.test_availability_zone.ServersControllerCreateTestV21.test_create_instance_with_availability_zone + +# This test has an eventlet and a threading version we +# should either combine them and make the dynamic or +# have the two variant executed conditionally +nova.tests.unit.test_rpc.TestRPC.test_get_server + +# ditto +nova.tests.unit.test_utils.ExecutorStatsTestCase.test_stats_logged_eventlet +nova.tests.unit.test_utils.OsloServiceBackendSelectionTestCase.test_eventlet_selected + +# This is exactly the same test as nova.tests.unit.test_rpc.TestRPC.test_get_server +# we should delete it +nova.tests.unit.test_rpc.TestRPC.test_get_server_profiler_enabled