diff --git a/Rakefile b/Rakefile index e1595e1..ca92ecf 100644 --- a/Rakefile +++ b/Rakefile @@ -8,6 +8,6 @@ require "logstash/devutils/rake" desc "Compile and put filewatch jar into lib/jars" task :vendor do - exit(1) unless system './gradlew clean jar' + exit(1) unless system './gradlew --no-daemon clean jar' puts "-------------------> built filewatch jar via rake" end diff --git a/spec/filewatch/rotate_spec.rb b/spec/filewatch/rotate_spec.rb index cf85704..f4e5979 100644 --- a/spec/filewatch/rotate_spec.rb +++ b/spec/filewatch/rotate_spec.rb @@ -73,7 +73,8 @@ module FileWatch FileUtils.mv(directory.join("1.logtmp").to_path, file1_path) end .then("wait for expectation") do - wait(2).for{listener1.calls}.to eq([:open, :accept, :accept, :accept]) + sleep(0.25) # if ENV['CI'] + wait(2).for { listener1.calls }.to eq([:open, :accept, :accept, :accept]) end .then("quit") do tailing.quit diff --git a/spec/filewatch/spec_helper.rb b/spec/filewatch/spec_helper.rb index 0490536..f2d32d7 100644 --- a/spec/filewatch/spec_helper.rb +++ b/spec/filewatch/spec_helper.rb @@ -1,6 +1,6 @@ # encoding: utf-8 require "rspec_sequencing" -# require 'rspec/wait' +require 'rspec/wait' require "logstash/devutils/rspec/spec_helper" require "concurrent" require "timecop" diff --git a/spec/inputs/file_read_spec.rb b/spec/inputs/file_read_spec.rb index 9b38dc6..298b5f2 100644 --- a/spec/inputs/file_read_spec.rb +++ b/spec/inputs/file_read_spec.rb @@ -70,7 +70,7 @@ end events = input(conf) do |pipeline, queue| - wait(0.5).for{IO.read(log_completed_path)}.to match(/A\.log/) + wait(0.75).for { IO.read(log_completed_path) }.to match(/A\.log/) 2.times.collect { queue.pop } end expect(events.map{|e| e.get("message")}).to contain_exactly("hello", "world") @@ -137,7 +137,7 @@ CONFIG events = input(conf) do |pipeline, queue| - wait(0.5).for{IO.read(log_completed_path)}.to match(/#{file_path.to_s}/) + wait(0.75).for { IO.read(log_completed_path) }.to match(/#{file_path.to_s}/) 2.times.collect { queue.pop } end @@ -171,7 +171,7 @@ CONFIG events = input(conf) do |pipeline, queue| - wait(0.5).for{IO.read(log_completed_path)}.to match(/uncompressed\.log/) + wait(0.75).for{ IO.read(log_completed_path) }.to match(/uncompressed\.log/) 2.times.collect { queue.pop } end @@ -205,7 +205,7 @@ CONFIG events = input(conf) do |pipeline, queue| - wait(0.5).for{IO.read(log_completed_path).scan(/compressed\.log\.gz(ip)?/).size}.to eq(2) + wait(0.75).for { IO.read(log_completed_path).scan(/compressed\.log\.gz(ip)?/).size }.to eq(2) 4.times.collect { queue.pop } end diff --git a/spec/inputs/file_tail_spec.rb b/spec/inputs/file_tail_spec.rb index 367ce07..7aefc69 100644 --- a/spec/inputs/file_tail_spec.rb +++ b/spec/inputs/file_tail_spec.rb @@ -67,7 +67,7 @@ path => "#{path_path}" start_position => "beginning" sincedb_path => "#{sincedb_path}" - "file_sort_by" => "path" + file_sort_by => "path" delimiter => "#{TEST_FILE_DELIMITER}" } } @@ -176,7 +176,7 @@ context "when sincedb_path is a directory" do let(:name) { "E" } subject { LogStash::Inputs::File.new("path" => path_path, "sincedb_path" => directory) } - + after :each do FileUtils.rm_rf(sincedb_path) end