opendistro-for-elasticsearch / performance-analyzer

📈 OpenDistro Performance Analyzer
https://opendistro.github.io/
Apache License 2.0
146 stars 49 forks source link

Fix ElectionTermCollector UT #304

Closed meetshah777 closed 3 years ago

meetshah777 commented 3 years ago

By default collector is disable and because of that UT is failing. Fixed the UT for ElectionTerm Collector.

sruti1312 commented 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?