Last active
January 23, 2017 06:15
-
-
Save xuncheng/34168408a1b059f917b5bd1cf4672e43 to your computer and use it in GitHub Desktop.
fix `Elasticsearch::Transport::Transport::Errors::ServiceUnavailable: [503]`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# fixed: Elasticsearch::Transport::Transport::Errors::ServiceUnavailable: [503] | |
# https://hugotunius.se/2015/06/22/elasticsearch-falkiness-in-tests.html | |
# https://medium.com/@thetron/dealing-with-503-errors-when-testing-elasticsearch-integration-in-rails-ec7a5f828274#.ex6quza03 | |
# https://github.com/elastic/elasticsearch-ruby/issues/181#issuecomment-112781924 | |
# spec/support/elasticsearch_cleaner.rb | |
RSpec.configure do |config| | |
config.before(:each, :es => true) do | |
ElasticsearchModel.create_index!(:force => true) | |
ElasticsearchModel.client.cluster.health(wait_for_status: 'yellow') | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment