Skip to content

updates to locustfile#394

Merged
m-goggins merged 16 commits into
mainfrom
local-load-testing
Jun 3, 2025
Merged

updates to locustfile#394
m-goggins merged 16 commits into
mainfrom
local-load-testing

Conversation

@m-goggins

@m-goggins m-goggins commented May 30, 2025

Copy link
Copy Markdown
Collaborator

Description

This PR updates the locustfile for load testing to:

  • Check whether the MPI has been seeded based on user input
  • Add a flag for number of records to link to better control the load testing size
  • Loop through the original data (1.5 M records), randomly choose a record, and send to the link endpoint. Repeat until the number of records to link has been reached

Related Issues

Closes #393

Additional Notes

If you have better ideas for randomly selecting records from the original data, I'm all ears, because I'm worried it will make seeding artificially slow. Right now, the original_data file is too large to load into memory to allow for random indexing so it loops through the records and randomly decides if they should be linked. It seems unlikely that we'd test all 1.5M records so the first records would be more heavily tested. This probably doesn't matter for load testing but I wanted to point it out.

The other option I considered (but ruled out) was to create the list of records that would be linked during the seeding process, i.e., when looping through the clusters_iter in the on_start section, you could also randomize whether a cluster gets added to a record_to_link list. However, we'd likely run into the same issue with the list being too large to hold in memory. We could write the list to file and then read from that in the link task, but it would only remove line 85 if random.random() < 0.5.

Curious to hear other ideas!

@codecov

codecov Bot commented May 30, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.51%. Comparing base (4ee75ca) to head (3a8d048).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #394   +/-   ##
=======================================
  Coverage   98.51%   98.51%           
=======================================
  Files          33       33           
  Lines        1948     1948           
=======================================
  Hits         1919     1919           
  Misses         29       29           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@m-goggins m-goggins marked this pull request as ready for review May 30, 2025 17:37

@ericbuckley ericbuckley left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, you can just pin mypy to 1.15.0 in pyproject.toml to get around the type checking issue.

Comment thread pyproject.toml
Comment thread tests/load/locustfile.py Outdated
Comment thread tests/load/locustfile.py Outdated
Comment thread tests/load/locustfile.py Outdated
@m-goggins m-goggins requested a review from ericbuckley June 2, 2025 16:05
Comment thread tests/load/locustfile.py Outdated
@m-goggins m-goggins merged commit f6ef4bf into main Jun 3, 2025
15 checks passed
@m-goggins m-goggins deleted the local-load-testing branch June 3, 2025 16:57
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.

Update locustfile to run load test

2 participants