From 9a905a862f42ed2de3d5de9d8d3f228d04c867d0 Mon Sep 17 00:00:00 2001 From: John Bintz Date: Thu, 15 Mar 2012 17:13:18 -0400 Subject: [PATCH] some fixes to ensure runner times out on js failure in runtine --- lib/flowerbox/rack.rb | 2 +- lib/flowerbox/run/test.rb | 4 +++- lib/flowerbox/runner/base.rb | 9 +++++++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/lib/flowerbox/rack.rb b/lib/flowerbox/rack.rb index f9ca25d..d0dcf95 100644 --- a/lib/flowerbox/rack.rb +++ b/lib/flowerbox/rack.rb @@ -60,7 +60,7 @@ module Flowerbox end command :starting do - + runner.did_start! end get %r{^/__F__/(.*)$} do |file| diff --git a/lib/flowerbox/run/test.rb b/lib/flowerbox/run/test.rb index 779b552..3c9954b 100644 --- a/lib/flowerbox/run/test.rb +++ b/lib/flowerbox/run/test.rb @@ -7,11 +7,13 @@ module Flowerbox::Run time = 0 realtime = Time.now.to_i + failed = false runner_envs = Flowerbox.runner_environment.collect do |env| env.ensure_configured! result_set << env.run(sprockets, spec_files, options) + failed = true if !env.started? time += env.time @@ -22,7 +24,7 @@ module Flowerbox::Run runner_envs.each(&:cleanup) - result_set.exitstatus + failed ? 1 : result_set.exitstatus rescue Flowerbox::Runner::Base::RunnerDiedError 255 end diff --git a/lib/flowerbox/runner/base.rb b/lib/flowerbox/runner/base.rb index 08e2f3f..43365c5 100644 --- a/lib/flowerbox/runner/base.rb +++ b/lib/flowerbox/runner/base.rb @@ -11,6 +11,11 @@ module Flowerbox def initialize @results = ResultSet.new + @started = false + end + + def started? + @started end def ensure_alive @@ -90,6 +95,10 @@ module Flowerbox @results.time = time end + def did_start! + @started = true + end + def server return @server if @server