fixes for when browsers die
This commit is contained in:
parent
7afc799775
commit
63ffe14692
@ -19,6 +19,8 @@ Flowerbox =
|
||||
started: false
|
||||
done: false
|
||||
|
||||
xhrObjects: {}
|
||||
|
||||
onQueueStateChange: ->
|
||||
|
||||
queueRunner: (failsafe = 5) ->
|
||||
|
@ -63,7 +63,9 @@ module Flowerbox
|
||||
begin
|
||||
browser.close
|
||||
rescue Errno::ECONNREFUSED => e
|
||||
puts "Browser already closed."
|
||||
puts "Browser already closed.".foreground(:yellow)
|
||||
rescue ::Selenium::WebDriver::Error::UnknownError => e
|
||||
puts "Unknown browser error, pushing past it to close...".foreground(:yellow)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -48,7 +48,7 @@ module Flowerbox::Result
|
||||
end
|
||||
|
||||
def first_local_stack
|
||||
@first_local_stack ||= stack[1..-1].find do |line|
|
||||
@first_local_stack ||= (stack[1..-1] || []).find do |line|
|
||||
!system_files.any? { |file| line[%r{\(#{file}}] }
|
||||
end || stack[1] || ''
|
||||
end
|
||||
|
@ -78,6 +78,10 @@ module Flowerbox
|
||||
end
|
||||
|
||||
@results
|
||||
rescue ExecJS::RuntimeError => e
|
||||
puts e.message.foreground(:red)
|
||||
|
||||
raise RunnerDiedError.new
|
||||
end
|
||||
|
||||
def configured?
|
||||
|
@ -21,7 +21,16 @@ module Flowerbox
|
||||
|
||||
def run(sprockets, spec_files, options)
|
||||
super do
|
||||
browser.navigate.to "http://localhost:#{server.port}/"
|
||||
navigate = Proc.new { browser.navigate.to "http://localhost:#{server.port}/" }
|
||||
|
||||
begin
|
||||
navigate.call
|
||||
rescue ::Selenium::WebDriver::Error::UnknownError => e
|
||||
puts "Browser communication error, reopening all browsers...".foreground(:yellow)
|
||||
Flowerbox.cleanup!
|
||||
|
||||
navigate.call
|
||||
end
|
||||
|
||||
ensure_alive
|
||||
end
|
||||
|
@ -3,6 +3,7 @@ require 'net/http'
|
||||
require 'socket'
|
||||
require 'rack/builder'
|
||||
require 'thin'
|
||||
require 'eventmachine'
|
||||
|
||||
module Flowerbox
|
||||
class Server
|
||||
|
Loading…
Reference in New Issue
Block a user