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

[WIP] POC for actor-based simulation testing framework #9302

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

itstauq
Copy link
Member

@itstauq itstauq commented Sep 18, 2024

Description

simtester is a lightweight simulation testing framework designed to run concurrent actor-based scenarios. By defining custom actors (such as DataScientist) with specific actions, users can simulate real-world behaviors and test workflows at scale. Each actor performs random actions and then rests during a cooldown period, enabling realistic load testing and workflow simulations.

Benefits

  • Concurrency: Simulates multiple actors running in parallel for realistic testing scenarios.
  • Custom Actions: Easily define and extend actor behaviors using the @action decorator.
  • Dynamic Cooldowns: Incorporates cooldown periods for more accurate, real-world behavior.
  • Flexible: Run simulations with any combination of actors and actions to suit different use cases.
  • Efficient Testing: Helps identify potential bottlenecks in workflows by modeling concurrent user behaviors.

Instructions

Follow these steps to get started:

  1. Install the Package
    From the root directory of the repo, run the following command to install simtester in editable mode:

    pip install -e 'packages/simtester'
  2. Run a Simulation
    To spawn 5 instances of the DataScientist actor and 1 instance of the Admin actor, use this command:

    cd tests/scenarios/bigquery/
    simtester level_2_sim_test.py::DataScientist 5 level_2_sim_test.py::Admin 1
  3. What Happens Next

    • Actors will Spawn Concurrently: Five DataScientist actors and one Admin actor will be created and start running at the same time.
    • Random Actions: Each actor will randomly select and execute one of its available actions. These are methods in the class that are marked with the @action decorator.
    • Cooldown: After performing an action, each actor will enter a cooldown period, which is randomly selected between 1 to 5 seconds, as defined in the cooldown_period tuple.
  4. Simulation Behavior

    • Actors continue to perform random actions and rest during cooldowns until the simulation completes.

Additional notes

  • This is a POC for an alternate approach to simulation testing with easily configurable user count.
  • This is in a very early stage, so feel free to reach out for any clarifications regarding the setup or running of simulations.

@itstauq itstauq self-assigned this Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant