vikaskr22 opened a new pull request, #625: URL: https://github.com/apache/ranger/pull/625
## What changes were proposed in this pull request? Fix for intermittent test cases failure in TestKMSMetricsWrapper. **RCA:** Counters are incremented at REST layer. Earlier we didn't have UT for KMS.createKey() REST API. TestKMSMetricsWrapper was incrementing the counter and asserting the same (1 as expected value) by fetching the counter value through metric collector API. Since this was the only place from where counter was being incremented, so it was working fine. Recently, Team added more test cases in TestKMS.java, that creates more keys and hence counter increased. And in TestKMSMetricsWrapper file, it was still expecting "1" as expected value, hence failed. Hadoop metric2 API doesn't provide API to reset the counters as it is made for continuous monitoring. Solution: Now we are explicitly flushing before each metric test execution and reading the value , And expected value is readValue + 1. ## How was this patch tested? - mvn build is working. - Changes are in test file and all test cases are passing. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
