fork web server, makes much more sense
This commit is contained in:
parent
5aa50699f0
commit
7e5c7f5987
|
@ -9,10 +9,11 @@ task "qunit:test" => :environment do
|
||||||
end
|
end
|
||||||
|
|
||||||
port = ENV['TEST_SERVER_PORT'] || 60099
|
port = ENV['TEST_SERVER_PORT'] || 60099
|
||||||
server = Thread.new do
|
unless pid = fork
|
||||||
Rack::Server.start(:config => "config.ru",
|
Rack::Server.start(:config => "config.ru",
|
||||||
:AccessLog => [],
|
:AccessLog => [],
|
||||||
:Port => port)
|
:Port => port)
|
||||||
|
exit
|
||||||
end
|
end
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
@ -23,7 +24,7 @@ task "qunit:test" => :environment do
|
||||||
# wait for server to respond, will exception out on failure
|
# wait for server to respond, will exception out on failure
|
||||||
tries = 0
|
tries = 0
|
||||||
begin
|
begin
|
||||||
rake_system(cmd)
|
sh(cmd)
|
||||||
rescue
|
rescue
|
||||||
sleep 2
|
sleep 2
|
||||||
tries += 1
|
tries += 1
|
||||||
|
@ -32,7 +33,7 @@ task "qunit:test" => :environment do
|
||||||
|
|
||||||
# A bit of a hack until we can figure this out on Travis
|
# A bit of a hack until we can figure this out on Travis
|
||||||
tries = 0
|
tries = 0
|
||||||
while tries < 3 && $?.exitstatus === 124
|
while tries < 3 && $?.exitstatus === 124 && !quit
|
||||||
tries += 1
|
tries += 1
|
||||||
puts "\nTimed Out. Trying again...\n"
|
puts "\nTimed Out. Trying again...\n"
|
||||||
rake_system(cmd)
|
rake_system(cmd)
|
||||||
|
@ -41,7 +42,7 @@ task "qunit:test" => :environment do
|
||||||
success &&= $?.success?
|
success &&= $?.success?
|
||||||
|
|
||||||
ensure
|
ensure
|
||||||
server.kill
|
Process.kill "HUP", pid
|
||||||
end
|
end
|
||||||
|
|
||||||
if success
|
if success
|
||||||
|
|
Loading…
Reference in New Issue