Class picker incorrectly populates Parsed Options
See original GitHub issueDescribe the bug
When using the Web UI’s class picker, Parsed Options are incorrectly populated
Expected behavior
Each name of a picked class is available as a single item in the environment.parsed_options.user_classes
list
Example when selecting the class “PurchaseUser”:
Actual behavior
When choosing classes through class picker, the name of the class is broken into characters. Each character is present as its own item in the environment.parsed_options.user_classes
list.
Example when selecting the class “PurchaseUser”:
Steps to reproduce
- Start locust with the --class-picker option and without specifying a user class through the CLI
- Select a class from the class picker menu and start the test
- Access the
environment.parsed_options.user_classes
list in thetest_start
listener
@events.test_start.add_listener
def on_test_start(environment, **__):
user_classes = environment.parsed_options.user_classes
log.info(user_classes)
Environment
- OS: MacOS Big Sur (11.4)
- Python version: 3.7.9
- Locust version: 2.12.0
- Locust command line that you ran:
locust --class-picker
- Locust file contents (anonymized if necessary):
import logging
import time
from locust import HttpUser, task, between, events
log = logging.getLogger(__name__)
@events.test_start.add_listener
def on_test_start(environment, **_):
user_classes = environment.parsed_options.user_classes
log.info(user_classes)
class PurchaseUser(HttpUser):
wait_time = between(1, 5)
@task
def hello_world(self):
self.client.get("/hello")
self.client.get("/world")
@task(3)
def view_items(self):
for item_id in range(10):
self.client.get(f"/item?id={item_id}", name="/item")
time.sleep(1)
def on_start(self):
self.client.post("/login", json={"username":"foo", "password":"bar"})
Issue Analytics
- State:
- Created a year ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Material DatePicker parses incorrectly if user write date in input
In my angular 4 project I am using some matDatepicker, It works correctly if I select a date from datepicker but if I...
Read more >optparse — Parser for command line options — Python 3.11.1 ...
A list of Option objects to populate the parser with. The options in option_list are added after any options in standard_option_list (a class...
Read more >Populate a Select Dropdown List using JSON - Code by Amir
In this article, we'll walk through code that populates a dropdown ... Target the dropdown; Clear any existing options; Insert a default ...
Read more ><input type="datetime-local"> - HTML - MDN Web Docs
The problem is with the client side of things: parsing of dates with more than 4 digits in the year.
Read more >Problems — CVXPY 1.2 documentation
The Problem class is the entry point to specifying and solving optimization ... backward() populates the gradient attribute of each Parameter in the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think this is happening when
/swarm
updates environment.parsed_options. I’ll try to get a fix in today or tomorrow@Vino4 's comment makes sense to me.