mirror of
https://github.com/ruby/ruby.git
synced 2026-08-16 02:15:57 +08:00
SleepingUnblockScheduler#unblock deliberately breaks the join path,
so the inner Thread.new{sleep(0.01)} created inside Fiber.schedule
is abandoned mid-sleep when the outer thread exits. It eventually
wakes and lingers in Thread.list, breaking cleanup_threads in later
test files (e.g. test/-ext-/thread/test_instrumentation_api.rb).
Capture the inner thread and join it in an ensure.
18) Failure:
TestThreadInstrumentation#test_thread_pass_multi_thread [/build/ruby4.0/test/-ext-/thread/test_instrumentation_api.rb:289]:
<[#<Thread:0x00007f8dbc9b7f48 run>]> expected but was
<[#<Thread:0x00007f8dbc9b7f48 run>,
#<Thread:0x00007f8dbc9f45b0 /build/ruby4.0/test/fiber/test_thread.rb:165 sleep>]>.