Replies: 4 comments
-
No, that's currently not possible and I don't think it would be feasible. Resource locks need to be known prior to execution (to avoid deadlocks) and method parameters are only known during execution. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the quick reply. I can setup a map of locks inside my test to do this but the downside is that all the test methods run immediately and wait on the locks which means that the resulting test duration is completely inaccurate. Is there any way to affect start time from inside a running test - i.e. I'd set the start time to be after the test has obtained the locks? I'm guessing not but maybe? |
Beta Was this translation helpful? Give feedback.
-
No, there's no way to do that. |
Beta Was this translation helpful? Give feedback.
-
OK - thanks for the info. |
Beta Was this translation helpful? Give feedback.
-
Is there a way to lock based on the input of a parameterized test?
With something like...
I'd like to lock on the resource being passed.
So
testA("Foo")
could run concurrently withtestB("Bar")
but not withtestB("Foo")
.Is that currently possible?
If not could
ResourceLocksProvider#provideForMethod
be changed to also accept theMethodSource
values?e.g.
Where
methodArgs
would be"Foo"
when runningtestA("Foo")
Beta Was this translation helpful? Give feedback.
All reactions