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 <noreply@anthropic.com>
This commit is contained in:
Yukihiro "Matz" Matsumoto
2026-05-28 12:02:07 +09:00
parent 20d8e202a2
commit dfc542dbc5
+4
View File
@@ -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