From 360e51cc3ae866ef49165b8e5c88261bb451e996 Mon Sep 17 00:00:00 2001 From: Jake Ororke Date: Wed, 11 Dec 2024 16:41:33 -0800 Subject: [PATCH] Update src/python_testing/matter_testing_infrastructure/chip/testing/matter_testing.py Adding commi from Cecille to the code here to help better clarify and explain reasoning for this coding change. Co-authored-by: C Freeman --- .../chip/testing/matter_testing.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/python_testing/matter_testing_infrastructure/chip/testing/matter_testing.py b/src/python_testing/matter_testing_infrastructure/chip/testing/matter_testing.py index f7aed80c452444..564c1dfc41cbef 100644 --- a/src/python_testing/matter_testing_infrastructure/chip/testing/matter_testing.py +++ b/src/python_testing/matter_testing_infrastructure/chip/testing/matter_testing.py @@ -1126,7 +1126,9 @@ def setup_class(self): self.step_skipped = False self.global_wildcard = asyncio.wait_for(self.default_controller.Read(self.dut_node_id, [(Clusters.Descriptor), Attribute.AttributePath(None, None, GlobalAttributeIds.ATTRIBUTE_LIST_ID), Attribute.AttributePath( None, None, GlobalAttributeIds.FEATURE_MAP_ID), Attribute.AttributePath(None, None, GlobalAttributeIds.ACCEPTED_COMMAND_LIST_ID)]), timeout=60) - # self.stored_global_wildcard stores value of self.global_wildcard after first async call, appears needed in order to not timeout during commissioning + # self.stored_global_wildcard stores value of self.global_wildcard after first async call. + # Because setup_class can be called before commissioning, this variable is lazy-initialized + # where the read is deferred until the first guard function call that requires global attributes. self.stored_global_wildcard = None def setup_test(self):