# frozen_string_literal: true
require './spec/cases/helper'

Parallel::Worker.class_eval do
  alias_method :work_without_kill, :work
  def work(*args)
    Process.kill("SIGKILL", pid)
    sleep 0.5
    work_without_kill(*args)
  end
end

begin
  Parallel.map([1, 2, 3]) do |_x, _i|
    Process.kill("SIGKILL", Process.pid)
  end
rescue Parallel::DeadWorker
  puts "DEAD"
end
