Skip to content

Commit 9c32ff4

Browse files
committed
added test_to_s_timelimit test
1 parent 2c5096c commit 9c32ff4

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

test-base/variables_test.rb

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,34 @@ def test_to_s_raises_exception
199199
send_cont
200200
end
201201

202+
def test_to_s_timelimit
203+
create_socket ['class A',
204+
'def to_s',
205+
'a = 1',
206+
'loop do',
207+
'a = a + 1',
208+
'sleep 1',
209+
'break if (a > 2)',
210+
'end',
211+
'a.to_s',
212+
'end',
213+
'end',
214+
'b = Hash.new',
215+
'b[A.new] = A.new',
216+
'b[1] = A.new',
217+
'puts b #bp here']
218+
run_to_line(15)
219+
send_ruby('v l')
220+
assert_variables(read_variables, 1,
221+
{:name => "b", :value => "Hash (2 elements)", :type => "Hash"})
222+
223+
send_ruby("v i b")
224+
assert_variables(read_variables, 2,
225+
{:name => "Timeout: evaluation of to_s took longer than 100ms.", :value => "Timeout: evaluation of to_s took longer than 100ms.", :type => "A"},
226+
{:name => "1", :value => "Timeout: evaluation of to_s took longer than 100ms.", :type => "A"})
227+
send_cont
228+
end
229+
202230
def assert_xml(expected_xml, actual_xml)
203231
# XXX is there a better way then html_escape in standard libs?
204232
assert_equal(ERB::Util.html_escape(expected_xml), actual_xml)

test/rd_test_base.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def debug_command(script, port)
2424
cmd << " -J-Xdebug -J-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y" if jruby? and debug_jruby?
2525
cmd << " -I 'lib:#{File.dirname(script)}' #{@rdebug_ide}" +
2626
(@verbose_server ? " -d" : "") +
27-
" -p #{port} -- '#{script}'"
27+
" -p #{port} --evaluation-control --time-limit 100 --memory-limit 0 -- '#{script}'"
2828
end
2929

3030
def start_debugger

0 commit comments

Comments
 (0)