mirror of
https://github.com/ruby/ruby.git
synced 2026-01-26 20:19:19 +00:00
[ruby/timeout] 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 https://github.com/ruby/timeout/commit/1c5eacbf9a) +PRISM [arm64-darwin24]
make: *** [yes-test-all] Error 1
```
https://github.com/ruby/timeout/commit/e5bc1de901
This commit is contained in:
parent
64062792c6
commit
dc58d58a72
@ -6,8 +6,10 @@ class TestTimeout < Test::Unit::TestCase
|
||||
|
||||
private def kill_timeout_thread
|
||||
thread = Timeout.const_get(:State).instance.instance_variable_get(:@timeout_thread)
|
||||
thread.kill
|
||||
thread.join
|
||||
if thread
|
||||
thread.kill
|
||||
thread.join
|
||||
end
|
||||
end
|
||||
|
||||
def test_public_methods
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user