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

Allow worker process to run with --run-time specified, just log a warning about it being ignored #2685

Merged
merged 2 commits into from
Apr 22, 2024

Conversation

Sawiq
Copy link

@Sawiq Sawiq commented Apr 20, 2024

As discussed here

@cyberw
Copy link
Collaborator

cyberw commented Apr 21, 2024

Looks good apart from the type check fail (which probably isnt really your fault, but still needs to be fixed)

@tdadela
Copy link
Contributor

tdadela commented Apr 21, 2024

    parts = timespan_regex.match(time_str)
    if not parts:
        raise ValueError("Invalid time span format. Valid formats: 20, 20s, 3m, 2h, 1h20m, 3h30m10s, etc.")
    parts = parts.groupdict()

The same variable name is used for storing two different types.
One of the solutions is simply to rename the parts variable.

Before this PR def parse_timespan(time_str): was untyped so mypy was skipping checking it:
"note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs"

@cyberw
Copy link
Collaborator

cyberw commented Apr 21, 2024

Yes that looks terrible. Renaming makes sense I think!

@Sawiq
Copy link
Author

Sawiq commented Apr 22, 2024

I have removed reassignment and called groupdict inline within list comprehension.

@cyberw cyberw changed the title Removed an error upon providing run_time for a worker process Allow worker process to run with --run-time specified, just log a warning Apr 22, 2024
@cyberw cyberw merged commit a89d334 into locustio:master Apr 22, 2024
14 checks passed
@cyberw cyberw changed the title Allow worker process to run with --run-time specified, just log a warning Allow worker process to run with --run-time specified, just log a warning about it being ignored Apr 22, 2024
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.

3 participants