State setup/tearDown order guaranties

Alexei Osipov osipov.av at gmail.com
Wed Jan 17 03:21:16 UTC 2018


Hello,

Are there any docs on execution order guaranties for "setup/tearDown" 
methods in @State objects with dependencies?

I'm getting unexpected "setup" method execution order when I mix states 
with @State(Scope.Group) and @State(Scope.Thread) that use 
@Setup(Level.Iteration) on fixture methods.

Test case: 
https://gist.github.com/alexei-osipov/1afd9c0482900b5f2b1248a3d99164d5
I'm getting a stable assertion error with it. The issue disappears when 
I change fixture levels to "Iteration".

So I wonder if I'm doing something wrong or JMH just does not provide 
order guaranties for the case with @State(Scope.Thread) + 
@Setup(Level.Iteration). Any recommendations on what should I check?

JMH: 1.19

Best regards,
Alexei Osipov


More information about the jmh-dev mailing list