project-chip / certification-tool

A test harness and tooling designed to simplify development, testing, and certification for devices, guided by the Connectivity Standards Alliance.
https://csa-iot.org/
Apache License 2.0
42 stars 24 forks source link

[Bug] Circular import error when launching TH #483

Closed rquidute closed 2 weeks ago

rquidute commented 2 weeks ago

Describe the bug

Circular import error when launching TH. It seems it affects the onboarding test cases. This happens in spring2025 branch.

Steps to reproduce the behavior

No response

Expected behavior

No response

Log files

ERROR | 2024-11-05 14:59:51.476 | app.test_engine.test_collection_discovery:find_classes_of_type:160 | Traceback (most recent call last): File "/app/backend/app/test_engine/test_collection_discovery.py", line 157, in find_classes_of_type submodule = importlib.import_module(submodule_name) File "/usr/lib/python3.10/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1050, in _gcd_import File "", line 1027, in _find_and_load File "", line 1006, in _find_and_load_unlocked File "", line 688, in _load_unlocked File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "/app/backend/test_collections/matter/python_tests/onboarding_payload_test_suite/tcdd11/init.py", line 16, in from .tcdd11 import TCDD11 File "/app/backend/test_collections/matter/python_tests/onboarding_payload_test_suite/tcdd11/tcdd11.py", line 19, in from ..onboarding_script_support import PayloadParsingTestBaseClass File "/app/backend/test_collections/matter/python_tests/onboarding_payload_test_suite/onboarding_script_support.py", line 21, in from ...sdk_tests.support.chip.chip_server import CHIP_TOOL_EXE File "/app/backend/test_collections/matter/sdk_tests/support/chip/chip_server.py", line 31, in from ..sdk_container import DOCKER_LOGS_PATH, DOCKER_PAA_CERTS_PATH, SDKContainer File "/app/backend/test_collections/matter/sdk_tests/support/sdk_container.py", line 33, in from .python_testing.models.python_testing_hooks_proxy import SDKPythonTestRunnerHooks File "/app/backend/test_collections/matter/sdk_tests/support/python_testing/init.py", line 24, in from .sdk_python_tests import ( File "/app/backend/test_collections/matter/sdk_tests/support/python_testing/sdk_python_tests.py", line 21, in from .models.python_test_models import PythonTestType File "/app/backend/test_collections/matter/sdk_tests/support/python_testing/models/init.py", line 16, in from .test_case import PythonTestCase File "/app/backend/test_collections/matter/sdk_tests/support/python_testing/models/test_case.py", line 37, in from ...sdk_container import SDKContainer ImportError: cannot import name 'SDKContainer' from partially initialized module 'test_collections.matter.sdk_tests.support.sdk_container' (most likely due to a circular import) (/app/backend/test_collections/matter/sdk_tests/support/sdk_container.py)

PICS file

No response

Screenshots

No response

Environment

No response

Additional Information

No response

rquidute commented 2 weeks ago

Closing since, https://github.com/project-chip/certification-tool-backend/pull/166 was reverted and it was the root cause.