Skip to content

Conversation

@1234-ad
Copy link

@1234-ad 1234-ad commented Oct 2, 2025

Description

This PR addresses issue #3203 by adding comprehensive documentation about the limitations of using -f - (distributed locustfile) with multiple files.

Changes

  • Added new documentation file docs/distributed-limitations.rst
  • Clearly explains why -f - doesn't work with multiple files
  • Provides practical workarounds for multi-file test structures
  • Includes examples of both problematic and working approaches

Why this change?

Issue #3203 highlighted that the current documentation mentions -f - works for "single locustfiles" but doesn't clearly explain the implications for users with multi-file test structures. This leads to confusion and ModuleNotFoundError when users try to import from other modules.

Benefits

  • Prevents user frustration - Clear upfront explanation of limitations
  • Provides solutions - Multiple workaround strategies
  • Improves developer experience - Users can make informed architectural decisions
  • Reduces support burden - Fewer duplicate issues about import errors

Documentation Structure

The new file covers:

  1. Clear explanation of the single-file limitation
  2. Examples of what doesn't work and why
  3. Multiple workaround strategies
  4. Example of proper single-file structure

This addresses the maintainer's comment that "serving multiple files is a bit thorny" by documenting the current limitations while providing practical alternatives.

Addresses issue locustio#3203 by documenting the limitations of using -f - with 
multiple files and providing clear workarounds for users who need 
multi-file test structures in distributed mode.
@cyberw
Copy link
Collaborator

cyberw commented Oct 2, 2025

It is nice that you provide all this info but it is a little too verbose. Specifically the code example is not necessary, and I think it something only <1% of locust users will care about so it doesnt deserve its own top level page in the docs.

Maybe add it under the FAQ and link it from the note that is already there next to the introduction of -f - ("The -f - argument tells Locust to get the locustfile from master instead of from its local filesystem. This only works for single locustfiles.")

@cyberw cyberw added the stale Issue had no activity. Might still be worth fixing, but dont expect someone else to fix it label Nov 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale Issue had no activity. Might still be worth fixing, but dont expect someone else to fix it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants