Skip to content

Conversation

@SoulSniper1212
Copy link

@SoulSniper1212 SoulSniper1212 commented Nov 8, 2025

Overview

This pull request implements the abort.after.time.lapsed.in.seconds feature to allow load tests to be automatically aborted after a specified time period. It adds a timeout mechanism to the ExecutorServiceRunner class that checks elapsed time at key points during test execution and throws a runtime exception if the configured timeout is exceeded.

Checklist

  • Code changes are complete
  • Tests pass
  • Documentation updated (if applicable)

Proof that changes are correct

The implementation adds a new abortAfterTimeLapsedInSeconds field and parameter to the ExecutorServiceRunner constructor. The timeout check is performed at multiple points in the execution flow:

  1. Before each loop iteration
  2. Before executing each thread
  3. After sleeping between threads
  4. While waiting for tasks to complete

The timeout check is wrapped in a private isTimeoutExceeded method that compares the elapsed time since the start of the test with the configured timeout. When the timeout is exceeded, a runtime exception is thrown and the executor service is shut down. This ensures that tests will not run indefinitely and can be controlled by the configured timeout value.

Signed-off-by: SoulSniper1212 <warush23@gmail.com>
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