Adding wait_for when index is being updated
Closed this issue · 1 comments
vryazanov commented
Hi there,
have a problem when I'm writing tests for elasticsearch. every time I need to add something like time.sleep()
in the test code to wait while ES index is updated.
I'd like to use wait_for params but cannot find the nice way to use it.
Do you have any solutions?
vryazanov commented
def elasticsearch_monkeypatch(monkeypatch):
patched_index = functools.partialmethod(
Elasticsearch.index,
refresh='wait_for')
monkeypatch.setattr(Elasticsearch, 'index', patched_index)