Fix the helpers tests.

ES doesn't guarantee that refresh will wait for cluster state
propagation and thus the type might not exist right after the index
being created during the bulk load. Just check the documents instead.
This commit is contained in:
Honza Král
2013-11-19 22:33:53 +01:00
parent 1c279d5aad
commit a4e068c505
@@ -103,8 +103,7 @@ class TestReindex(ElasticTestCase):
self.client.indices.refresh()
self.assertTrue(self.client.indices.exists("prod_index"))
self.assertTrue(self.client.indices.exists_type("prod_index", "answers"))
self.assertTrue(self.client.indices.exists_type("prod_index", "questions"))
self.assertEquals(100, self.client.count(index='prod_index')['count'])
self.assertEquals(50, self.client.count(index='prod_index', doc_type='questions')['count'])
self.assertEquals(50, self.client.count(index='prod_index', doc_type='answers')['count'])
self.assertEquals({"answer": 42, "correct": True}, self.client.get(index="prod_index", doc_type="answers", id=42)['_source'])