mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user