Description
Following the change of #38903 the way we create the .ml-annotations-6
index will cause occasional assertion failures in tests that extend ESSingleNodeTestCase
. One such failure is https://elasticsearch-ci.elastic.co/job/elastic+elasticsearch+7.0+internalClusterTest/589/consoleText
Currently the .ml-annotations-6
index is created by a cluster state listener if any other ML index exists. This is nice for production, because it avoids the clutter of unconditionally creating .ml-annotations-6
if ML is not in use, yet makes sure it is available for creating annotations as soon as any ML functionality is used. But it is nasty for tests, as creation of the index can spill from one test into another.
Some ideas for fixing this could be:
- Switch all ML tests that extend
ESSingleNodeTestCase
to instead extend an intermediate ML test base class that has extra cleanup code. The extra cleanup would need to:- Check if any ML indices existed
- If so, wait for the
.ml-annotations-6
index to exist - Delete the other ML indices found in step 1.
- Call the super class cleanup
or
- Add a setting to disable creation of the ML annotations index and aliases. Set this in
ESSingleNodeTestCase
. Any ML tests that were testing ML annotations would have to explicitly create it.
There might be better ways. Any thoughts?