FakeMetrics breaks with multiple tests
ewolak-sq opened this issue · comments
E. Wolak commented
If I write one test class (annotated with @MiskTest(startService = true)
) with an @Inject lateinit var metrics: FakeMetrics
field and two @Test
methods, the metrics
field will get reinitialized between the first and second test but the FakeMetrics
injected into my service persists. So then I'm fetching values on metrics
and not finding them, because even in the second test they were getting recorded on the first instance of FakeMetrics
.
Jesse Wilson commented
After investigation we blame companion object
and not FakeMetrics.
E. Wolak commented
😩