Fix flaky tests for DatabaseMetric
What does this MR do and why?
Problem
Tests were modifying DatabaseMetric class directly, so changes made in one test were leaking to another.
Solution
Create a dynamic class inherited from DatabaseMetric, it will exist only in scope of the test and it should prevent scope leak.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.