Skip to content

Commit

Permalink
Add basic circuit breaker if we detect extra ruby process
Browse files Browse the repository at this point in the history
  • Loading branch information
benoittgt committed Jun 29, 2020
1 parent 5a540c8 commit f233fa4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions spec/integration/bisect_spec.rb
Expand Up @@ -45,7 +45,10 @@ def bisect(cli_args, expected_status=nil)
it 'does not leave zombie processes', :unless => RSpec::Support::OS.windows? do
original_pids = pids()
bisect(%W[spec/rspec/core/resources/blocking_pipe_bisect_spec.rb_], 1)
cursor = 0
while ((extra_pids = pids() - original_pids).join =~ /[RE]/i)
raise "Extra process detected" if cursor > 10
cursor += 1
sleep 0.1
end
expect(extra_pids.join).to_not include "Z"
Expand Down

0 comments on commit f233fa4

Please sign in to comment.