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: make the Launcher abstraction less opinionated #3273

Merged
merged 4 commits into from
Jul 25, 2024
Merged

Commits on Jul 18, 2024

  1. refactor: make the Launcher abstraction less opinionated

    After these changes the Launcher will delegate more of how a test
    is run down to the actual implementation of the runtime platform
    (e.g. local, AWS Lambda, AWS Fargate or something else).
    
    It will no longer manage workers directly via createWorker(),
    prepareWorker() etc.
    
    The only concerns handled in Launcher now are to:
    
    - Initialize a runtime platform implementation
    - Subscribe to events emitted by the platform
      - Worker-level events such as 'stats' or 'phaseCompleted' and
        aggregate metric reports from multiple workers
    hassy committed Jul 18, 2024
    Configuration menu
    Copy the full SHA
    9134f9c View commit details
    Browse the repository at this point in the history

Commits on Jul 19, 2024

  1. fix: explicitly stop worker threads

    This was previously done at Launcher level, but
    has now been delegated to platform implementation
    hassy committed Jul 19, 2024
    Configuration menu
    Copy the full SHA
    bbd4fee View commit details
    Browse the repository at this point in the history

Commits on Jul 22, 2024

  1. fix: allow workers to communicate recoverable errors

    A worker may encounter an error that does not necessarily require
    stopping the execution of a test script, e.g. a local worker may not
    be able to load a plugin. The worker can communicate such errors
    by setting a "level" property on the workerError message.
    
    This change takes level into account for determining whether the
    worker has stopped running or not.
    
    Previous version of this code has a bug, where the stoppedError
    state assigned to the worker [1] would get overridden elsewhere
    meaning that the condition that determined whether all workers
    exited [2] would not evaluate to true as expected. It also had
    the same issue of not taking level into account, meaning that
    code that handled loading plugins in local worker threads[3] should
    have stopped the execution of a test early, but didn't.
    
    1. https://github.com/artilleryio/artillery/blob/1f6e1c6d95d943f1ee6e5ef5b422f8ea70c24b85/packages/artillery/lib/launch-platform.js#L79
    2. https://github.com/artilleryio/artillery/blob/1f6e1c6d95d943f1ee6e5ef5b422f8ea70c24b85/packages/artillery/lib/launch-platform.js#L242
    3. https://github.com/artilleryio/artillery/blob/1f6e1c6d95d943f1ee6e5ef5b422f8ea70c24b85/packages/artillery/lib/platform/local/worker.js#L160-L167
    hassy committed Jul 22, 2024
    Configuration menu
    Copy the full SHA
    a378d08 View commit details
    Browse the repository at this point in the history

Commits on Jul 25, 2024

  1. test: increase test duration

    Increase the duration of the test to make sure that at least one
    intermediate report is produced before the workers are terminated
    due to OOM. An assertion in an e2e test relies on having at least
    one intermediate report produced:
    
    https://github.com/artilleryio/artillery/blob/5a01e3632c4b6959ad94299bd7caf37397331c6b/packages/artillery/test/cloud-e2e/fargate/memory.test.js#L22
    hassy committed Jul 25, 2024
    Configuration menu
    Copy the full SHA
    e640b79 View commit details
    Browse the repository at this point in the history