Skip to content

Commit d9a995f

Browse files
authored
MCORE-FS-1.4: Wait for dynamic endpoint to appear on TH_FSA (#36013)
* MCORE-FS-1.4: Wait for dynamic endpoint to appear on TH_FSA Fixes #35348 * Timeout for getting dynamic endpoint
1 parent b04ec4f commit d9a995f

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

src/python_testing/TC_MCORE_FS_1_4.py

+14-13
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,7 @@ def start(self):
9494
super().start(expected_output="Successfully opened pairing window on the device")
9595

9696
def commission_on_network(self, node_id: int, setup_pin_code: int, filter_type=None, filter=None):
97-
self.send(
98-
f"pairing onnetwork {node_id} {setup_pin_code}",
99-
expected_output=f"Commissioning complete for node ID {node_id:#018x}: success")
97+
self.send(f"pairing onnetwork {node_id} {setup_pin_code}")
10098

10199

102100
class TC_MCORE_FS_1_4(MatterBaseTest):
@@ -266,16 +264,19 @@ async def test_TC_MCORE_FS_1_4(self):
266264
filter=discriminator,
267265
)
268266

269-
# Wait some time, so the dynamic endpoint will appear on the TH_FSA_BRIDGE.
270-
await asyncio.sleep(5)
271-
272-
# Get the list of endpoints on the TH_FSA_BRIDGE after adding the TH_SERVER_NO_UID.
273-
th_fsa_bridge_endpoints_new = set(await self.read_single_attribute_check_success(
274-
cluster=Clusters.Descriptor,
275-
attribute=Clusters.Descriptor.Attributes.PartsList,
276-
node_id=th_fsa_bridge_th_node_id,
277-
endpoint=0,
278-
))
267+
get_dynamic_endpoint_retries = 60
268+
th_fsa_bridge_endpoints_new = set(th_fsa_bridge_endpoints)
269+
# Try to get the dynamic endpoint number for the TH_SERVER_NO_UID on the TH_FSA_BRIDGE.
270+
while th_fsa_bridge_endpoints_new == th_fsa_bridge_endpoints and get_dynamic_endpoint_retries > 0:
271+
await asyncio.sleep(0.5)
272+
get_dynamic_endpoint_retries -= 1
273+
# Get the list of endpoints on the TH_FSA_BRIDGE.
274+
th_fsa_bridge_endpoints_new.update(await self.read_single_attribute_check_success(
275+
cluster=Clusters.Descriptor,
276+
attribute=Clusters.Descriptor.Attributes.PartsList,
277+
node_id=th_fsa_bridge_th_node_id,
278+
endpoint=0,
279+
))
279280

280281
# Get the endpoint number for just added TH_SERVER_NO_UID.
281282
logging.info("Endpoints on TH_FSA_BRIDGE: old=%s, new=%s", th_fsa_bridge_endpoints, th_fsa_bridge_endpoints_new)

0 commit comments

Comments
 (0)