From ab9bf882e92784045817a05685d62884d21d7431 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Fri, 24 Jan 2020 20:56:39 +0100 Subject: [PATCH] Simplify shelling out helpers in remote debugging tests --- test/support/remote_debugging_tests.rb | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/test/support/remote_debugging_tests.rb b/test/support/remote_debugging_tests.rb index bdb3e829f..f2439e261 100644 --- a/test/support/remote_debugging_tests.rb +++ b/test/support/remote_debugging_tests.rb @@ -56,17 +56,15 @@ def write_program(code) end def remote_debug_and_connect(*commands) - remote_debug(*commands) do |wait_th| + remote_debug(*commands) do launch_client wait_for_client_startup - - wait_th.value end end def remote_debug_connect_and_interrupt(*commands) - remote_debug(*commands) do |wait_th, err_th| + remote_debug(*commands) do |err_th| th = Thread.new { launch_client } wait_for_client_startup @@ -74,7 +72,6 @@ def remote_debug_connect_and_interrupt(*commands) th.kill err_th.join - wait_th.value end end @@ -84,7 +81,9 @@ def remote_debug(*commands) Open3.popen3(shell_out_env, "ruby #{example_path}") do |_i, _o, e, wait_thr| err_thr = Thread.new { print e.read } - yield(wait_thr, err_thr) + yield(err_thr) + + wait_thr.value end end