Class: ActiveMutator::Scheduler
- Inherits:
-
Object
- Object
- ActiveMutator::Scheduler
- Defined in:
- lib/active_mutator/scheduler.rb
Overview
Fork pool: one fork per WorkItem, capped at jobs concurrent forks.
Parent enforces per-item deadlines with SIGKILL (worker-side timeouts
cannot interrupt all infinite loops).
Instance Method Summary collapse
-
#initialize(jobs:, worker: Worker.method(:run), on_result: nil) ⇒ Scheduler
constructor
A new instance of Scheduler.
- #run(items) ⇒ Object
Constructor Details
Instance Method Details
#run(items) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/active_mutator/scheduler.rb', line 14 def run(items) previous_traps = nil running = {} previous_traps = install_signal_handlers(running) results = [] # Browser-covered mutants each boot Chrome + an app server; running them # concurrently melts CPUs and manufactures false timeouts. Parallel lane # first at full width, then the serial lane one at a time. results.concat(run_pool(items.select { |i| i.lane == :parallel }, @jobs, running)) results.concat(run_pool(items.select { |i| i.lane == :serial }, 1, running)) results ensure restore_traps(previous_traps) if previous_traps end |