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

Importing any locust plugin breaks the UI and distributed load generation. #1870

Closed
Serhiy1 opened this issue Sep 2, 2021 · 3 comments
Closed
Labels

Comments

@Serhiy1
Copy link

Serhiy1 commented Sep 2, 2021

Describe the bug

importing any plugins from the locust plugins directory seems to break the UI and distributed load generation.
I have particularly used the run_single_user and Transaction manager plugins.

This is how the UI looks if you import either of the two

image

If you run the following in distributed mode, only filling out the default parameters: (Number of users, spawn rate, host) you will consistently get the following exception.

Traceback (most recent call last):                                                                                                                                                                            
   File "/usr/local/lib/python3.8/site-packages/gevent/pywsgi.py", line 999, in handle_one_response                                                                                                            
     self.run_application()                                                                                                                                                                                    
   File "/usr/local/lib/python3.8/site-packages/gevent/pywsgi.py", line 945, in run_application                                                                                                                
     self.result = self.application(self.environ, self.start_response)                                                                                                                                         
   File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 2088, in __call__                                                                                                                          
     return self.wsgi_app(environ, start_response)                                                                                                                                                             
   File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 2073, in wsgi_app                                                                                                                          
     response = self.handle_exception(e)                                                                                                                                                                       
   File "/usr/local/lib/python3.8/site-packages/flask_cors/extension.py", line 165, in wrapped_function                                                                                                        
     return cors_after_request(app.make_response(f(*args, **kwargs)))                                                                                                                                          
   File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 2070, in wsgi_app                                                                                                                          
     response = self.full_dispatch_request()                                                                                                                                                                   
   File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1515, in full_dispatch_request                                                                                                             
     rv = self.handle_user_exception(e)                                                                                                                                                                        
   File "/usr/local/lib/python3.8/site-packages/flask_cors/extension.py", line 165, in wrapped_function                                                                                                        
     return cors_after_request(app.make_response(f(*args, **kwargs)))                                                                                                                                          
   File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1513, in full_dispatch_request                                                                                                             
     rv = self.dispatch_request()                                                                                                                                                                              
   File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1499, in dispatch_request                                                                                                                  
     return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)                                                                                                                              
   File "/home/locust/.local/lib/python3.8/site-packages/locust/web.py", line 384, in wrapper                                                                                                                  
     return view_func(*args, **kwargs)                                                                                                                                                                         
   File "/home/locust/.local/lib/python3.8/site-packages/locust/web.py", line 154, in swarm                                                                                                                    
     parsed_options_dict[key] = type(parsed_options_dict[key])(value)                                                                                                                                          
 TypeError: NoneType takes no arguments                                                                                                                                                                        
 2021-09-01T17:52:19Z {'REMOTE_ADDR': '::ffff:127.0.0.1', 'REMOTE_PORT': '40020', 'HTTP_HOST': 'localhost:8089', (hidden keys: 33)} failed with TypeError

Expected behaviour

Importing singular plugins should not generate so many custom parameters and distributed load generation should still continue to work.

Steps to reproduce

Here is a small repo project based off the delivery hero example

example.zip

To observe the broken UI, you can run locust -f main_broken.py locally.

To observe distributed builds being broken you will need to deploy the test in a distributed fashion. I have used Kubernetes and the provided helm chart to do so.

EDIT

Looks like you can repo this issue without the need to run in distributed mode. run run locust -f main_broken.py and set the host to https://www.google.com

Environment

  • OS:

  • Python version: 3.8

  • Locust version: 2.2.0

  • Locust command line that you ran:

@Serhiy1 Serhiy1 added the bug label Sep 2, 2021
@cyberw
Copy link
Collaborator

cyberw commented Sep 2, 2021

Are you on latest locust-plugins? (1.4.1) I use this daily and havent seen any issues...

The massive list of arguments in the UI when running locust-plugins is sort of a known issue. A PR to fix it would be welcome. Maybe by somehow tagging custom arguments that they should not be shown in the UI. But I dont have the time to fix it myself...

@Serhiy1
Copy link
Author

Serhiy1 commented Sep 2, 2021

I'm on the latest available version of locust plugins.

$ pip list | grep locust
locust                          2.2.0               
locust-plugins                  1.4.1      

Which plugins do you use? I'll check if this is plugin-specific.

@cyberw cyberw closed this as completed in 645475e Sep 2, 2021
cyberw added a commit that referenced this issue Sep 2, 2021
…ers-of-None-or-boolean-type-in-web-ui

Disable setting custom parameters of None or boolean type in web UI. Fixes #1870
@cyberw
Copy link
Collaborator

cyberw commented Sep 2, 2021

Try it out the latest version with pip install locust==2.2.1.dev4 and see if it helps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants