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

Exception then test stops if run in headless mode and autoquit != -1 #1915

Closed
EzR1d3r opened this issue Oct 26, 2021 · 6 comments
Closed

Exception then test stops if run in headless mode and autoquit != -1 #1915

EzR1d3r opened this issue Oct 26, 2021 · 6 comments
Labels
bug stale Issue had no activity. Might still be worth fixing, but dont expect someone else to fix it

Comments

@EzR1d3r
Copy link
Contributor

EzR1d3r commented Oct 26, 2021

Describe the bug

Exception then test stops
venv\lib\site-packages\locust\main.py", line 327, in stop_and_optionally_quit
web_ui.stop()
AttributeError: 'NoneType' object has no attribute 'stop'

Expected behavior

Stop without exception

Actual behavior

Steps to reproduce

Run test in destributed mode with headless = true and autoquit = 0.

Environment

  • OS:
  • Python version: 3.9
  • Locust version: 2.4.0
  • Locust command line that you ran:
  • Locust file contents (anonymized if necessary):
@EzR1d3r EzR1d3r added the bug label Oct 26, 2021
EzR1d3r added a commit to EzR1d3r/locust that referenced this issue Oct 26, 2021
Fix the case when locust stops with exception in headless mode with autoquit != -1
@cyberw
Copy link
Collaborator

cyberw commented Oct 26, 2021

Did you run with headless AND autostart? Those settings are not meant to be combined, as headless already implies autostart...

@EzR1d3r
Copy link
Contributor Author

EzR1d3r commented Nov 12, 2021

Did you run with headless AND autostart? Those settings are not meant to be combined, as headless already implies autostart...

Yes, I run it with headless and autostart. But I think more friendly if user dont need keep in mind, what if he changes settings headless, he needs also change autostart to work programm correctly. )

@cyberw
Copy link
Collaborator

cyberw commented Nov 12, 2021

I guess so, but that is not the intended way (and most commonly would happen because the user is confused and thinks they need to specify autostart) so if we want to support that then we should at least log a warning.

If you add that I can merge.

@cyberw
Copy link
Collaborator

cyberw commented Nov 12, 2021

Or maybe we dont need to warn, but we should at least invert that if-statement to check for headless instead of autostart. There should be no difference at all in what code gets executed when someone has added --autostart in addition to --headless.

EzR1d3r added a commit to EzR1d3r/locust that referenced this issue Nov 12, 2021
Fix the case when locust stops with exception in headless mode
with autostart and autoquit != -1.
Warning for using --autostart in headless mode or worker process.
@EzR1d3r
Copy link
Contributor Author

EzR1d3r commented Nov 12, 2021

Or maybe we dont need to warn, but we should at least invert that if-statement to check for headless instead of autostart. There should be no difference at all in what code gets executed when someone has added --autostart in addition to --headless.

Already added a warning. ) But I will think about this proposal.

cyberw added a commit that referenced this issue Nov 12, 2021
@github-actions
Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 10 days.

@github-actions github-actions bot added the stale Issue had no activity. Might still be worth fixing, but dont expect someone else to fix it label Jan 12, 2022
@EzR1d3r EzR1d3r closed this as completed Jan 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug stale Issue had no activity. Might still be worth fixing, but dont expect someone else to fix it
Projects
None yet
Development

No branches or pull requests

2 participants