Closed vasigorc closed 2 years ago
Closing this issue. While there could be an issue creating mocks relying on type class derivation, the reason for excessive logs was because this creation was throwing an exception and thus killing the actor hosting it. After that the parent Akka actor was constantly trying to restart the killed actor and the loop continued...
To correct the issue I refactored the code to encapsulate the derivation part in the wrapping service.
ScalaMock Version 5.2.0
Scala Version 2.13.8
Runtime JVM
The issue (context)
We have a service similar to the one below:
Where
getObservabilityImplementation
can return any implementation of any platform. The implementation translator looks like this:In the code we would use this as follows:
...and we would test it as follows:
Actual behaviour
Tests pass but there's numerous logs that get printed, similar to this:
to the extent that a build on our Jenkins server cause host to run out of space.
Note that removing the
implicit
modifier and passing atranslator
explicitly gets rid of the logs.Expected behaviour
Regardless whether derivation is done via an implicit or explicit parameter these excessive logs should not occur.