mirror of
https://github.com/thoughtbot/capybara-webkit
synced 2023-03-27 23:22:28 -04:00
Do at_exit first to make sure server is always killed, also put a select in so it fails a bit more gracefully after 10 seconds if something goes wrong with the server
This commit is contained in:
parent
d0cf8f8ec4
commit
13fe01c55d
1 changed files with 4 additions and 3 deletions
|
@ -72,10 +72,11 @@ class Capybara::Driver::Webkit
|
|||
read_pipe.close
|
||||
exec(server_path)
|
||||
end
|
||||
write_pipe.close
|
||||
@server_port = ((read_pipe.first || '').match(/listening on port: (\d+)/) || [])[1]
|
||||
|
||||
at_exit { Process.kill("INT", @pid) }
|
||||
|
||||
write_pipe.close
|
||||
return unless IO.select([read_pipe], nil, nil, 10)
|
||||
@server_port = ((read_pipe.first || '').match(/listening on port: (\d+)/) || [])[1]
|
||||
end
|
||||
|
||||
def connect
|
||||
|
|
Loading…
Reference in a new issue