Open avpotapov00 opened 7 months ago
I think the third approach is more correct in every sense, except for the case when we don’t have time for this
I think we eventually should refactor TestThreadExecutionGenerator
. See, e.g. this issue #196
Let's collect all the problems with current implementation that we want to solve with the refactoring.
Currently, we store validation functions as
Actor
insideExecutionScenario
etc., butActor
contains additional information about the operation, defined by user, and logically has fewer limitations:cancelOnSuspension
,allowExtraSuspension
,blocking
,causesBlocking
,promptCancellation
,isSuspendable
of theActor
class makes no sense in case of a validation function. The only reason for doing this is that it's easier to useTestThreadExecutionGenerator
, which hasTestThreadExecution create(Runner runner, int iThread, List<Actor> actors,...
method.We can fix it in two ways:
TestThreadExecutionGenerator
. But, for example, propertyisSuspendable
always will returnfalse
in case of validation function, so it looks weird and redundant, especially because it is needed only for one place in code.TestThreadExecutionGenerator
. This approach requires minimum code changes and development time but leads to some amount of small object allocations (for wrappers). We need to measure whether this results in decreased performance.TestThreadExecutionGenerator
to make it able to create executions for validation methods too.