Skip to content

Commit 77bbe94

Browse files
committed
fix running test on 1.9
1 parent 92f246b commit 77bbe94

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

test-base/test_base.rb

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ def default_test
5353

5454
def teardown
5555
unless @fast_fail # much faster fail
56+
if (not passed?)
57+
send_ruby("cont")
58+
end
5659
debug "Waiting for the server process to finish..."
5760
(config_load('server_start_up_timeout')*4).times do
5861
unless @process_finished
@@ -85,7 +88,11 @@ def start_ruby_process(script)
8588
debug "Starting: #{cmd}\n"
8689

8790
Thread.new do
88-
(_, p_out, p_err) = Open3.popen3(cmd)
91+
if RUBY_VERSION < '1.9'
92+
(_, p_out, p_err) = Open3.popen3(cmd)
93+
else
94+
(_, p_out, p_err, wait_thr) = Open3.popen3(cmd)
95+
end
8996
@process_finished = false
9097
out_t = Thread.new do
9198
p_out.each do |line|
@@ -97,9 +104,14 @@ def start_ruby_process(script)
97104
$stdout.printf("SERVER ERR: " + line) if @verbose_server
98105
end
99106
end
100-
out_t.join
101-
err_t.join
102-
fail "ERROR: \"#{process}\" failed with exitstatus=#{$?.exitstatus}" unless $?.success?
107+
if RUBY_VERSION < '1.9'
108+
out_t.join
109+
err_t.join
110+
status = $?
111+
else
112+
status = wait_thr.value
113+
end
114+
fail "ERROR: \"#{process}\" failed with exitstatus=#{status.exitstatus}" unless status.success?
103115
@process_finished = true
104116
end
105117

test/rd_test_base.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ def debug_command(script, port)
2828
end
2929

3030
def start_debugger
31+
super()
3132
send_ruby("start")
3233
end
3334

0 commit comments

Comments
 (0)