elasticsearch-py icon indicating copy to clipboard operation
elasticsearch-py copied to clipboard

tests for parallel bulk rely on Mock.call_count which is not thread safe

Open honzakral opened this issue 6 years ago • 2 comments

We need to change the logic used to checking the calls made to something that can be incremented atomically like appending to a list or something.

honzakral avatar Aug 21 '19 10:08 honzakral

i wrote a test(pytest) for my elasticsearch project, when i run it, this error raise RequestError(400, 'index_closed_exception', 'closed') but, when run as debug and run step by step it's ok ... can this prove elasticsearch is not threading safe?

mosi-kha avatar Aug 22 '19 06:08 mosi-kha

@mosi-kha Elasticsearch is thread safe, it is mock which is not and it only affects this one test. What you are seeing is unrelated.

honzakral avatar Aug 22 '19 07:08 honzakral