Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Commit 8466fae

Browse files
committed
Further improve spec to focus on the recently exited bisect process
1 parent 290630b commit 8466fae

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

spec/integration/bisect_spec.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,15 @@ def bisect(cli_args, expected_status=nil)
4343
end
4444

4545
it 'does not leave zombie processes', :unless => RSpec::Support::OS.windows? do
46+
original_pids = pids()
4647
bisect(%W[spec/rspec/core/resources/blocking_pipe_bisect_spec.rb_], 1)
47-
expect(%x[ps -ho pid,state]).to_not include("Z")
48+
sleep 0.1 while (extra_pids = pids() - original_pids).join.match?(/[RE]/i)
49+
expect(extra_pids.join).to_not include "Z"
4850
end
4951
end
52+
53+
def pids
54+
%x[ps -ho pid,state].split("\n").map { |line| line.split(/\s+/).compact.join(' ') }
55+
end
5056
end
5157
end

0 commit comments

Comments
 (0)