From dfc542dbc5054737ac9c8459b9843fb0a442b7f0 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Thu, 28 May 2026 12:02:07 +0900 Subject: [PATCH] mruby-task: terminate suspended task in suspend test The "Task#suspend doesn't raise" test left its task parked in q_suspended_. A later test ("Task.run inside Task.run is a noop") calls Task.run, and the scheduler will not exit its loop while any task sits in the suspended (or waiting) queue, so the whole run hung. Terminate the task at the end of the suspend test so it does not leak into the shared scheduler state the next test depends on. This fixes the hang at its source rather than scrubbing leaked tasks from the consumer side. Refs #6866, #6867. Co-authored-by: Claude --- mrbgems/mruby-task/test/task.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mrbgems/mruby-task/test/task.rb b/mrbgems/mruby-task/test/task.rb index 048bb8136..678b136ab 100644 --- a/mrbgems/mruby-task/test/task.rb +++ b/mrbgems/mruby-task/test/task.rb @@ -81,6 +81,10 @@ end assert("Task#suspend doesn't raise") do task = Task.new { } assert_nothing_raised { task.suspend } + # Clean up: a suspended task left in q_suspended_ keeps a later + # Task.run from terminating (the scheduler idles waiting on it + # instead of exiting). + task.terminate end assert("Task#resume doesn't raise") do