Class: RSpec::Core::Bisect::ForkRunner::RunDispatcher

Inherits:
Object
  • Object
show all
Defined in:
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-core-3.12.0/lib/rspec/core/bisect/fork_runner.rb

Instance Method Summary collapse

Constructor Details

#initialize(runner, channel) ⇒ RunDispatcher

Returns a new instance of RunDispatcher.



80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-core-3.12.0/lib/rspec/core/bisect/fork_runner.rb', line 80

def initialize(runner, channel)
  @runner = runner
  @channel = channel

  @spec_output = StringIO.new

  runner.configuration.tap do |c|
    c.reset_reporter
    c.output_stream = @spec_output
    c.error_stream = @spec_output
  end
end

Instance Method Details

#dispatch_specs(run_descriptor) ⇒ Object



93
94
95
96
97
98
99
100
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-core-3.12.0/lib/rspec/core/bisect/fork_runner.rb', line 93

def dispatch_specs(run_descriptor)
  pid = fork { run_specs(run_descriptor) }
  # We don't use Process.waitpid here as it was causing bisects to
  # block due to the file descriptor limit on OSX / Linux. We need
  # to detach the process to avoid having zombie processes
  # consuming slots in the kernel process table during bisect runs.
  Process.detach(pid)
end