Skip to content

Commit f92ec91

Browse files
committed
Fix one of flakey test in protocol tests
1 parent ab937ac commit f92ec91

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test/support/protocol_test_case.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,12 +175,16 @@ def req_step_back
175175
end
176176

177177
def req_terminate_debuggee
178+
# Kernel#exit method will be called when the debuggee receives the following method.
178179
case get_target_ui
179180
when 'vscode'
180181
send_dap_request 'terminate'
181182
when 'chrome'
182183
send_cdp_request 'Runtime.terminateExecution'
183184
end
185+
# Ensure debuggee exit by waiting for Kernel#exit in server_cdp.rb to complete.
186+
# This `wait_pid` is called to prevent disconnection before the debuggee exits.
187+
flunk create_protocol_msg test_info, "Expected the debuggee program to finish" unless wait_pid @remote_info.pid, TIMEOUT_SEC
184188

185189
close_reader
186190
end

0 commit comments

Comments
 (0)