Skip to content

Commit 698e75d

Browse files
committed
Catch failure when trying to kill hung node in test
1 parent 430833f commit 698e75d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test/replica_set/client_test.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,11 @@ def test_connect_with_hung_first_node
206206
assert ['localhost:29999'] != @client.primary
207207
assert !@client.secondaries.include?('localhost:29999')
208208
ensure
209-
Process.kill("KILL", hung_node.pid) if hung_node
209+
begin
210+
Process.kill("KILL", hung_node.pid) if hung_node
211+
rescue
212+
# the process ended, was killed already, or the system doesn't support nc
213+
end
210214
end
211215
end
212216

0 commit comments

Comments
 (0)