GeorgeJahad opened a new pull request #2629: URL: https://github.com/apache/ozone/pull/2629
## What changes were proposed in this pull request? When the OM-HA code was added, the tests were not completely updated. Many of them still call the OzoneManagerProtocol "write-path" methods even though those methods have been superseded by the HA methods. This PR is a small beginning to the fix. I didn't want to do too much before getting some feedback, so I just removed a single api call, OzoneManager.deleteKey(), and fixed the corresponding tests, by changing them to invoke the ozoneManagerClient version. If there is a less hacky way of doing it, without using the client, please let me know. I couldn't find one. I tried creating an alternative, but it looked like a half-baked client, so I just used the real one. Most of the tests here are fixed by just replacing the OM with the client. I timed all the ones I changed and didn't notice any running longer. ### Notes on TestOmMetrics.testKeyOps() test The only test that was difficult to fix was the testKeyOps() test [here](https://github.com/apache/ozone/blob/79a9d39da7f33e71bc00183e280105562354cca4/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmMetrics.java#L243). This test verifies that keyOps generate the correct number of metrics. I tried to write the new code so the numbers didn't change. But there is actually a flaw in the original test that causes it to undercount a few, (*NumKeyLookupFails*, and *NumKeyDeleteFails*). So you'll see those fixed. The test depends on mocks of the KeyManager. But now that the OM no longer supports deleteKey(), those mocks won't work. So I had to replace most of them with actual working code; (because I couldn't find a way to mock the actual write path.) The test is divided into two halves. The first half verifies normal metrics; the second half verifies failure metrics. I removed the mocks in the first half; those metrics are now generated by real code. The mocks in the second half are there to force failures/exceptions. I modified those to work with the new code. ## What is the link to the Apache JIRA https://issues.apache.org/jira/browse/HDDS-3371 ## How was this patch tested? All effected tests were updated. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
