Skip to content

Commit e5bc1de

Browse files
luke-grubereregon
authored andcommitted
Fix failing timeout test
``` Run options: "--ruby=./miniruby -I../ruby/lib -I. -I.ext/common ../ruby/tool/runruby.rb --extout=.ext -- --disable-gems" --excludes-dir=../ruby/test/.excludes --name=!/memory_leak/ --seed=9843 [ 1/31] TestTimeout#test_timeout_in_trap_handler = 0.00 s 1) Error: TestTimeout#test_timeout_in_trap_handler: NoMethodError: undefined method 'kill' for nil /Users/luke/workspace/ruby-dev/ruby/test/test_timeout.rb:9:in 'TestTimeout#kill_timeout_thread' /Users/luke/workspace/ruby-dev/ruby/test/test_timeout.rb:424:in 'TestTimeout#test_timeout_in_trap_handler' Finished tests in 2.715032s, 11.4179 tests/s, 52.3014 assertions/s. 31 tests, 142 assertions, 0 failures, 1 errors, 0 skips ruby -v: ruby 4.0.0dev (2025-12-11T21:56:23Z fix_timeout_test 1c5eacbf9a) +PRISM [arm64-darwin24] make: *** [yes-test-all] Error 1 ```
1 parent d95f1b8 commit e5bc1de

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/test_timeout.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ class TestTimeout < Test::Unit::TestCase
66

77
private def kill_timeout_thread
88
thread = Timeout.const_get(:State).instance.instance_variable_get(:@timeout_thread)
9-
thread.kill
10-
thread.join
9+
if thread
10+
thread.kill
11+
thread.join
12+
end
1113
end
1214

1315
def test_public_methods

0 commit comments

Comments
 (0)