diff --git a/src/python_testing/TC_CGEN_2_8.py b/src/python_testing/TC_CGEN_2_8.py index abef5a3fc67dda..5b51a0faaa1f1e 100644 --- a/src/python_testing/TC_CGEN_2_8.py +++ b/src/python_testing/TC_CGEN_2_8.py @@ -131,6 +131,9 @@ async def test_TC_CGEN_2_8(self): "First CommissioningComplete failed", ) + # Close the commissioner session with the device to clean up resources + commissioner.CloseSession(nodeid=self.dut_node_id) + # Step 5: Factory reset is handled by test operator self.step(5) if not self.check_pics('PICS_USER_PROMPT'): diff --git a/src/python_testing/TC_CGEN_2_9.py b/src/python_testing/TC_CGEN_2_9.py index 03521e5dd89b38..fb5ddfbdb9075e 100644 --- a/src/python_testing/TC_CGEN_2_9.py +++ b/src/python_testing/TC_CGEN_2_9.py @@ -159,6 +159,9 @@ async def test_TC_CGEN_2_9(self): self.step(5) await self.remove_commissioner_fabric() + # Close the commissioner session with the device to clean up resources + commissioner.CloseSession(nodeid=self.dut_node_id) + # Step 6: Put device in commissioning mode (requiring user input, so skip in CI) self.step(6) if not self.check_pics('PICS_USER_PROMPT'):