We have integration tests for our queries to elastic (to ensure that proper data is returned). Therefore we create several indexes per application branch (with unique name). For each test we create only a fiew record and run query.
Everything works fine on local machine, but on our build environment over time shared elastic instance behaves slowly. Our 200+ tests run for 1 min locally, and 3 min from build environment over network. But sometimes it slows down to 40 min. The slowest part is manual index refresh (so we ensure that all records are available on search).
We use default elastic docker container with 4 gb of heap for jvm.
What would you suggest to look at to overcome elastic slow downs? We reuse index per test run, but create a new index per branch since mappings are different and may not be compatible