Closed meetshah777 closed 3 years ago
We can enable the collector by mocking and setting the value to true. This will help us to test the collectMetrics
functionality.
Sample: https://github.com/opendistro-for-elasticsearch/performance-analyzer/blob/main/src/test/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/collectors/ShardStateCollectorTests.java#L103
Any reason why we cant go through this route instead of removing the test?
By default collector is disable and because of that UT is failing. Fixed the UT for ElectionTerm Collector.