Skip to content

Commit 495e361

Browse files
committed
Extend timeout
For some reason, `app.run spring_test_command` may take 100+ seconds. ``` `bundle check || bundle update --retry=2` 107.863471355 `bin/rake test /home/travis/build/mtsmfm/spring-debug/test/apps/tmp/test/controllers/posts_controller_test.rb` 105.624732034 `gem install activesupport --version '4.2.10'` 22.66985453 `bin/rails runner 'load Rails.root.join("script.rb")'` 11.518353908 `bin/rake test /home/travis/build/mtsmfm/spring-debug/test/apps/tmp/test/controllers/posts_controller_test.rb` 6.040077579 `bundle exec rails g scaffold post title:string` 4.525084902 ``` https://travis-ci.org/mtsmfm/spring-debug/jobs/404996066 I got above result by applying the following patch: ```diff diff --git a/lib/spring/test/application.rb b/lib/spring/test/application.rb index 9a00618..93f129e 100644 --- a/lib/spring/test/application.rb +++ b/lib/spring/test/application.rb @@ -119,6 +119,8 @@ module Spring puts dump_streams(command, output) if ENV["SPRING_DEBUG"] @times << (Time.now - start_time) if @times + $times ||= [] + $times << {command: command.to_s, time: Time.now - start_time} output.merge(status: status, command: command) rescue Timeout::Error diff --git a/test/acceptance_test.rb b/test/acceptance_test.rb index 665aff9..c24e82e 100644 --- a/test/acceptance_test.rb +++ b/test/acceptance_test.rb @@ -2,3 +2,11 @@ require_relative "helper" class AcceptanceTest < Spring::Test::AcceptanceTest end + +Minitest.after_run do + puts ?- * 100 + + $times.sort_by {|time| - time[:time] }.each do |time| + puts "`#{time[:command]}`\t#{time[:time]}" + end +end ```
1 parent 6f1203a commit 495e361

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/spring/test/application.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
module Spring
44
module Test
55
class Application
6-
DEFAULT_TIMEOUT = ENV['CI'] ? 30 : 10
6+
DEFAULT_TIMEOUT = ENV['CI'] ? 300 : 10
77

88
attr_reader :root, :spring_env
99

0 commit comments

Comments
 (0)