From 3f4424459c22ea58d3d00e5a8659c91aa9d0a591 Mon Sep 17 00:00:00 2001 From: Naoto Ono Date: Sun, 7 Jan 2024 21:48:32 +0900 Subject: [PATCH] Fix one of flakey test in protocol tests --- test/support/protocol_test_case.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/support/protocol_test_case.rb b/test/support/protocol_test_case.rb index 902955c0d..b92b0bb56 100644 --- a/test/support/protocol_test_case.rb +++ b/test/support/protocol_test_case.rb @@ -175,12 +175,16 @@ def req_step_back end def req_terminate_debuggee + # Kernel#exit method will be called when the debuggee receives the following method. case get_target_ui when 'vscode' send_dap_request 'terminate' when 'chrome' send_cdp_request 'Runtime.terminateExecution' end + # Ensure debuggee exit by waiting for Kernel#exit in server_cdp.rb to complete. + # This `wait_pid` is called to prevent disconnection before the debuggee exits. + flunk create_protocol_msg test_info, "Expected the debuggee program to finish" unless wait_pid @remote_info.pid, 3 close_reader end