I am experiencing some frustration when using the embedded Elasticsearch in integration tests. In the "before" of the test suite I run a createIndices and in the "after" I delete them; that randomly results in an IndexAlreadyExistsException
.
I tried calling refresh
and flush
, I tried clearing the caches in Elasticsearch, I tried retrying many times with delete and create before giving up but the exception stays and there seems to be no way around it.
To make things even more puzzling I tried getting the indices from Elasticsearch right before creating the index and as a result I always get an empty list, even when then the create request fails. If I do the same after the create index succeedes there are the expected indices in the response.
I am running on ES 2.3.1 but I also tried using the client for 2.3.1 with the server 2.4.0; that resulted in exactly the same behaviour.
Any idea on what else could I try? Thanks!