我在Jenkins中断断续续地收到以下错误,最近的错误发布在下面。我以前从未见过这个问题。一些开发人员使用CSS3推送一些CSS更改,这就是我开始收到错误的时候。我正在使用phantomjs version - 1.9.8。有什么想法吗?
Connection refused - connect(2) for "127.0.0.1" port 8910 (Errno::ECONNREFUSED)
/opt/chefdk/embedded/lib/ruby/2.1.0/net/http.rb:879:in `initialize'
/opt/chefdk/embedded/lib/ruby/2.1.0/net/http.rb:879:in `open'
/opt/chefdk/embedded/lib/ruby/2.1.0/net/http.rb:879:in `block in connect'
/opt/chefdk/embedded/lib/ruby/2.1.0/timeout.rb:91:in `block in timeout'
/opt/chefdk/embedded/lib/ruby/2.1.0/timeout.rb:101:in `call'
/opt/chefdk/embedded/lib/ruby/2.1.0/timeout.rb:101:in `timeout'
/opt/chefdk/embedded/lib/ruby/2.1.0/net/http.rb:878:in `connect'
/opt/chefdk/embedded/lib/ruby/2.1.0/net/http.rb:863:in `do_start'
/opt/chefdk/embedded/lib/ruby/2.1.0/net/http.rb:852:in `start'
/opt/chefdk/embedded/lib/ruby/2.1.0/net/http.rb:1375:in `request'发布于 2016-02-05 13:22:59
我假设您每次都会遇到这个错误,那么您需要在Jenkins上更新Selenium独立服务器。
如果您断断续续地遇到这个问题,那么您也可以尝试重新启动phantomjs
def restart_phantomjs
puts "-> Restarting phantomjs: iterating through capybara sessions..."
session_pool = Capybara.send('session_pool')
session_pool.each do |mode,session|
msg = " => #{mode} -- "
driver = session.driver
if driver.is_a?(Capybara::Poltergeist::Driver)
msg += "restarting"
driver.restart
else
msg += "not poltergeist: #{driver.class}"
end
puts msg
end
end
module_function :restart_phantomjs
endhttps://stackoverflow.com/questions/35158102
复制相似问题