Skip to content

Commit 84460e2

Browse files
committed
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 b10a85a commit 84460e2

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,15 +129,15 @@ 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'):
138135
self.skip_all_remaining_steps(6)
139136
return
140137

138+
# Close the commissioner session with the device to clean up resources
139+
commissioner.CloseSession(nodeid=self.dut_node_id)
140+
141141
self.wait_for_user_input(prompt_msg="Manually trigger factory reset on the DUT, then continue")
142142

143143
# Step 6: Put device in commissioning mode (requiring user input, so skip in CI)

0 commit comments

Comments
 (0)