Fix killing webkit_server on JRuby
Connection now waits until webkit_server has started to discover the pid.
This commit is contained in:
parent
40a5b251d2
commit
e2a8afb9c4
|
@ -47,12 +47,12 @@ module Capybara::Webkit
|
|||
def start_server
|
||||
open_pipe
|
||||
discover_port
|
||||
discover_pid
|
||||
forward_output_in_background_thread
|
||||
end
|
||||
|
||||
def open_pipe
|
||||
_, @pipe_stdout, @pipe_stderr, wait_thr = Open3.popen3(SERVER_PATH)
|
||||
@pid = wait_thr[:pid]
|
||||
_, @pipe_stdout, @pipe_stderr, @wait_thr = Open3.popen3(SERVER_PATH)
|
||||
register_shutdown_hook
|
||||
end
|
||||
|
||||
|
@ -81,6 +81,10 @@ module Capybara::Webkit
|
|||
end
|
||||
end
|
||||
|
||||
def discover_pid
|
||||
@pid = @wait_thr[:pid]
|
||||
end
|
||||
|
||||
def forward_output_in_background_thread
|
||||
Thread.new do
|
||||
Thread.current.abort_on_exception = true
|
||||
|
|
Loading…
Reference in New Issue