Can we test an object that needs initialization and teardown?
Aleksey Shipilev
shade at redhat.com
Tue Oct 9 13:24:07 UTC 2018
On 10/09/2018 01:22 PM, Adam Retter wrote:
> I just want to check whether this approach is sane? ...or if I am
> doing something totally nuts here?
Putting teardown into finally block in @Arbiter is probably okay.
But the "nuts" part is assuming it is sensible to have very heavy-weight @State. The harness is able
to capture concurrency bugs by executing lot of tests, and spending the significant time at
setup/teardown works against that. In other words, @State-s are created by millions per test
(because @Actor-s are basically one-shot per @State), instantiating and shutting down the database
every time does not look very sane.
-Aleksey
More information about the jcstress-dev
mailing list