From b0352860f2565bd069a7fd7aa16b30ba1dfd81bd Mon Sep 17 00:00:00 2001 From: Cezary Baginski Date: Sat, 22 Aug 2015 23:35:22 +0200 Subject: [PATCH 1/3] increase allowed lag on Travis+OSX --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 0b21738c..c2cc0a30 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,5 +17,6 @@ os: - linux - osx env: - - LISTEN_TESTS_DEFAULT_LAG=0.8 + # TODO: 0.8 is enough on Linux, but 2 seems needed for Travis/OSX + - LISTEN_TESTS_DEFAULT_LAG=2 sudo: false From a4786104081790c5e14f44e44dfa4facbfc48efc Mon Sep 17 00:00:00 2001 From: Cezary Baginski Date: Sat, 22 Aug 2015 23:35:37 +0200 Subject: [PATCH 2/3] fix randomly failing specs --- spec/lib/listen/adapter/linux_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/lib/listen/adapter/linux_spec.rb b/spec/lib/listen/adapter/linux_spec.rb index ac04e057..80b6f473 100644 --- a/spec/lib/listen/adapter/linux_spec.rb +++ b/spec/lib/listen/adapter/linux_spec.rb @@ -59,7 +59,6 @@ let(:adapter_options) { { events: [:recursive, :close_write] } } before do - allow(Kernel).to receive(:require).with('rb-inotify') fake_worker = double(:fake_worker) events = [:recursive, :close_write] allow(fake_worker).to receive(:watch).with('/foo/dir1', *events) @@ -78,6 +77,7 @@ allow(Listen::Change).to receive(:new).with(config, record). and_return(snapshot) + allow(subject).to receive(:require).with('rb-inotify') subject.configure end From 93a6a678f590dfbc8f5d10bfaa63c9b48eccdeb3 Mon Sep 17 00:00:00 2001 From: Cezary Baginski Date: Sat, 22 Aug 2015 23:36:36 +0200 Subject: [PATCH 3/3] remove obsolete Celluloid references --- spec/support/acceptance_helper.rb | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/spec/support/acceptance_helper.rb b/spec/support/acceptance_helper.rb index 8731281b..8f36d432 100644 --- a/spec/support/acceptance_helper.rb +++ b/spec/support/acceptance_helper.rb @@ -201,7 +201,6 @@ def listen(reset_queue = true) # Lag should include: # 0.1s - 0.2s if the test needs Listener queue to be processed # 0.1s in case the system is busy - # 0.1s - for celluloid overhead and scheduling sleep lag end @@ -228,9 +227,6 @@ def _add_changes(type, changes, dst) freeze_offset = @timed_changes.freeze_offset msg = "Changes took #{change_offset}s (allowed lag: #{freeze_offset})s" - - # Use STDERR (workaround for Celluloid, since it catches abort) - STDERR.puts msg abort(msg) end @@ -258,9 +254,8 @@ def _sleep_to_separate_events # separate the events or Darwin and Polling # will detect only the :added event # - # (This is because both use directory scanning - # through Celluloid tasks, which may not kick in - # time before the next filesystem change) + # (This is because both use directory scanning which may not kick in time + # before the next filesystem change) # # The minimum for this is the time it takes between a syscall # changing the filesystem ... and ... an async