From 71ffd9b521685cefd64f53eba989012701cef590 Mon Sep 17 00:00:00 2001 From: Godfrey Chan Date: Thu, 26 Nov 2015 02:52:00 -0800 Subject: Only run listen tests in isolation, for now There is a known issue with the listen tests that casuses files to be incorrectly GC'ed even when they are still in-use. The current is to only run them in isolation to avoid randomly failing our test suite. --- activesupport/test/file_evented_update_checker_test.rb | 5 +++++ ci/travis.rb | 17 ++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/activesupport/test/file_evented_update_checker_test.rb b/activesupport/test/file_evented_update_checker_test.rb index 071449d399..ec3a7e28f3 100644 --- a/activesupport/test/file_evented_update_checker_test.rb +++ b/activesupport/test/file_evented_update_checker_test.rb @@ -5,6 +5,11 @@ require 'file_update_checker_shared_tests' class FileEventedUpdateCheckerTest < ActiveSupport::TestCase include FileUpdateCheckerSharedTests + def setup + skip if ENV['LISTEN'] == '0' + super + end + def new_checker(files = [], dirs = {}, &block) ActiveSupport::FileEventedUpdateChecker.new(files, dirs, &block).tap do wait diff --git a/ci/travis.rb b/ci/travis.rb index 52fef05fbf..658d66c6b4 100755 --- a/ci/travis.rb +++ b/ci/travis.rb @@ -72,6 +72,10 @@ class Build key.join(':') end + def activesupport? + gem == 'activesupport' + end + def activerecord? gem == 'activerecord' end @@ -101,11 +105,22 @@ class Build tasks.each do |task| cmd = "bundle exec rake #{task}" puts "Running command: #{cmd}" - return false unless system(cmd) + return false unless system(env, cmd) end true end + def env + if activesupport? && !isolated? + # There is a known issue with the listen tests that casuses files to be + # incorrectly GC'ed even when they are still in-use. The current is to + # only run them in isolation to avoid randomly failing our test suite. + { 'LISTEN' => '0' } + else + {} + end + end + def run_bug_report_templates Dir.glob('bug_report_templates/*.rb').all? do |file| system(Gem.ruby, '-w', file) -- cgit v1.2.3