Skip to content

Commit 7d7d638

Browse files
authored
fix(testing): Move CloseSession call after factory reset in TC_CGEN_2_8 (#37776)
* fix(testing): Move CloseSession call after factory reset in TC_CGEN_2_8 The current implementation of commissioner.CloseSession only marks the session as defunct rather than fully closing it. This state can be reactivated if messages are exchanged on the session. By moving the CloseSession call to after the factory reset step, we ensure that the device session is already destroyed before marking it as defunct, preventing any possibility of message exchange that could reactivate the session. This allows the commissioner to successfully create a new session in subsequent steps. A follow-up change will be needed to properly fix the CloseSession function to use MarkForEviction instead of MarkAsDefunct, and potentially rename the current function to better reflect its behavior.
1 parent b38c5b8 commit 7d7d638

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/python_testing/TC_CGEN_2_8.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,6 @@ async def test_TC_CGEN_2_8(self):
129129
"First CommissioningComplete failed",
130130
)
131131

132-
# Close the commissioner session with the device to clean up resources
133-
commissioner.CloseSession(nodeid=self.dut_node_id)
134-
135132
# Step 5: Factory reset is handled by test operator
136133
self.step(5)
137134
if not self.check_pics('PICS_USER_PROMPT'):
@@ -140,6 +137,9 @@ async def test_TC_CGEN_2_8(self):
140137

141138
self.wait_for_user_input(prompt_msg="Manually trigger factory reset on the DUT, then continue")
142139

140+
# Close the commissioner session with the device to clean up resources
141+
commissioner.CloseSession(nodeid=self.dut_node_id)
142+
143143
# Step 6: Put device in commissioning mode (requiring user input, so skip in CI)
144144
self.step(6)
145145
self.wait_for_user_input(prompt_msg="Manually set the DUT into commissioning mode, then continue")

0 commit comments

Comments
 (0)