Skip to content

Commit

Permalink
- Try fixing the elasticsearch test (currently failing)
Browse files Browse the repository at this point in the history
  • Loading branch information
jordansissel committed Jan 30, 2012
1 parent 15058af commit c30da31
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/logstash/outputs/elasticsearch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ def register
@logger.setup_log4j

if @embedded
%w(host cluster bind_host).each do |name|
# Check for settings that are incompatible with @embedded
%w(host).each do |name|
if instance_variable_get("@#{name}")
@logger.error("outputs/elasticsearch: You cannot specify " \
"'embedded => true' and also set '#{name}'")
Expand Down
8 changes: 7 additions & 1 deletion test/logstash/outputs/test_elasticsearch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@
describe LogStash::Outputs::ElasticSearch do
before do
FileUtils.rm_r("data") if File.exists?("data")
@clustername = "#{$$}.#{rand(100000)}"
@output = LogStash::Outputs::ElasticSearch.new({
"type" => ["foo"],
"embedded" => ["true"],
"cluster" => [@clustername]
})
@output.register
end # before
Expand All @@ -41,7 +43,7 @@
end

tries = 30
es = LogStash::Search::ElasticSearch.new(:type => :local)
es = LogStash::Search::ElasticSearch.new(:cluster => @clustername)
while tries > 0
tries -= 1
puts "Tries left: #{tries}" if $DEBUG
Expand Down Expand Up @@ -72,5 +74,9 @@

sleep 0.2
end # while tries > 0

if tries == 0
raise "Failed to find results in elasticsearch"
end
end # test_elasticsearch_basic
end # testing for LogStash::Outputs::ElasticSearch

0 comments on commit c30da31

Please sign in to comment.