# Testing ES: Does es.indices.refresh() Block Until New Documents are Available for Python DSL?

**URL:** <https://discuss.elastic.co/t/testing-es-does-es-indices-refresh-block-until-new-documents-are-available-for-python-dsl/91335>\
**Category:** Elasticsearch\
**Created:** [June 29, 2017, 6:37pm UTC](https://discuss.elastic.co/t/testing-es-does-es-indices-refresh-block-until-new-documents-are-available-for-python-dsl/91335 "2017-06-29T18:37:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![junkmob](https://avatars.discourse-cdn.com/v4/letter/j/a4c791/32.png) [@junkmob](https://discuss.elastic.co/u/junkmob)\
**Post date:** [June 29, 2017, 6:37pm UTC](https://discuss.elastic.co/t/testing-es-does-es-indices-refresh-block-until-new-documents-are-available-for-python-dsl/91335/1 "2017-06-29T18:37:48Z")

</div>

Hello,  
I'm writing unittests for some of our indices using the Python `elasticsearch-dsl` ( for ES version 2.4 ). Does the call `es.indices.refresh(index=<index_name>)` block until the indices are refreshed? I'm using this on test suite `setUp` to make sure that my models are indexed and ready to be searched. The [docs](https://elasticsearch-py.readthedocs.io/en/master/api.html#elasticsearch.client.IndicesClient.refresh) make it sound like it will block until they are refreshed. But I'm experiencing weird behavior where my documents are not there.

Just want to make sure this is the intended behavior  
Thanks

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 27, 2017, 6:37pm UTC](https://discuss.elastic.co/t/testing-es-does-es-indices-refresh-block-until-new-documents-are-available-for-python-dsl/91335/2 "2017-07-27T18:37:53Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
