Skip to content

Commit a2e7564

Browse files
authored
fix(testing): Move CloseSession call after factory reset in TC_CGEN_2_8 (#37777)
* 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 4d96e83 commit a2e7564

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
@@ -119,9 +119,6 @@ async def test_TC_CGEN_2_8(self):
119119
"First CommissioningComplete failed",
120120
)
121121

122-
# Close the commissioner session with the device to clean up resources
123-
commissioner.CloseSession(nodeid=self.dut_node_id)
124-
125122
# Step 5: Factory reset is handled by test operator
126123
self.step(5)
127124
if not self.check_pics('PICS_USER_PROMPT'):
@@ -130,6 +127,9 @@ async def test_TC_CGEN_2_8(self):
130127

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

130+
# Close the commissioner session with the device to clean up resources
131+
commissioner.CloseSession(nodeid=self.dut_node_id)
132+
133133
# Step 6: Put device in commissioning mode (requiring user input, so skip in CI)
134134
self.step(6)
135135
self.wait_for_user_input(prompt_msg="Manually set the DUT into commissioning mode, then continue")

0 commit comments

Comments
 (0)