Skip to content

Commit 270efb3

Browse files
ben851Ben Larabie
andauthored
Failure scenario test limit fix (#2899)
* first crack at breaking perf test * debug 1 * debug 2 * test * testing * debugging blast script * test mode * add slack notifications * fix test limit * undo reverts --------- Co-authored-by: Ben Larabie <ben.larabie@blarabie-jtfk.home>
1 parent c4f060c commit 270efb3

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

tests_nightly_performance/src/blast_api.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,13 @@ def tick(self):
481481
opts = self.runner.environment.parsed_options
482482
spawn_rate = opts.spawn_rate # honours -r / locust.conf spawn-rate
483483

484+
# LoadTestShape normally causes Locust to ignore --run-time entirely.
485+
# Re-implement the check here so callers can impose a hard time cap
486+
# (e.g. TEST_MODE uses --run-time 2m to keep CI runs short).
487+
if opts.run_time and run_time >= opts.run_time:
488+
print(f"\n*** Run-time limit of {opts.run_time}s reached — stopping test ***")
489+
return None
490+
484491
# --- bulk-burst scenario ---
485492
if opts.bulk_burst:
486493
total_duration = opts.burst_count * opts.burst_delay

0 commit comments

Comments
 (0)