Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor runner API to avoid creating testInstance (and other scenario-specific logic) in case of GPMC #529

Open
wants to merge 32 commits into
base: develop
Choose a base branch
from

Conversation

eupp
Copy link
Collaborator

@eupp eupp commented Feb 17, 2025

This PR attempts to refactor the interaction of the Strategy class and the Runner class to make the Strategy runner-agnostic. The goal is to encapsulate the execution scenario specific logic related to data structures testing.

In particular, in this PR the testInstance object is not used (and thus not re-created) on each invocation when GPMC is used.

In more details, this PR:

  • introduces ExecutionScenarioRunner specific to execution scenario running logic;
  • introduces LambdaRunner specific to GPMC case when only lambda is used to run the test --- this runner avoids most complexities related to ExecutionScenarioRunner providing much simpler implementation;
  • simplifies common Runner interface.

Unfortunately, this PR does not completely decouples ManagedStrategy from the execution scenario logic, there are some leftovers that should be handled in the future in separate PRs (as this one is already quite large):

  • currentActorIsBlocking and concurrentActorCausesBlocking properties should probably be moved to ExecutionScenarioRunner;
  • scenario object is used in several places in ManagedStrategy (related to Treat first actor (operation) as regular method call #452 (comment));
  • number of threads in the scenario is used to distinguish between scenario threads and user-created threads --- in the future we should remove any distinction between the two in ManagedStrategy.

eupp added 30 commits February 11, 2025 01:05
* introduce `ActorTracker` and `ExecutionScenarioRunner` classes

Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
* rename from `FixedActiveThreadsExecutor` to `ActiveThreadPoolExecutor`
* do not use `TestThreadExecution` class, instead submit tasks as a `ThreadMap` mapping thread id to corresponding `Runnable`

Signed-off-by: Evgeniy Moiseenko <[email protected]>
* move all execution scenario related logic into `ParallelThreadsRunner`

Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
eupp added 2 commits February 17, 2025 01:57
Signed-off-by: Evgeniy Moiseenko <[email protected]>
Signed-off-by: Evgeniy Moiseenko <[email protected]>
@eupp eupp requested a review from ndkoval February 17, 2025 23:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants