-
Notifications
You must be signed in to change notification settings - Fork 3k
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
How to call on_start before each testcase, like setup in unittest? #781
Comments
similar feature is already implemented and the code has landed in master. |
@cgoldberg many thanks, and sorry for I didn't see that. |
@cgoldberg hi, I find out that the |
@ityoung, I'm sorry, but I don't understand your issue description or what you are asking. Can you clarify? |
@cgoldberg sorry for my poor english.. What I want:For a What I get:When I type Question:Is locust set |
I am also looking for a I would like to create/cleanup a resource before/after each taskset, and I don't want this resource to be reused. If I use Or I would need a way for locust to recreate a user each time to simulate independant users when using with LoadTestShape. |
I'm not sure why this issue is closed, but I'm looking for the same thing. I need to create a resource in the server's DB before making a request, and this needs to happen before each request (or task). I haven't found a hook that works this way. Any suggestions? |
There’s no built in way to do that, but you can override the run task method, as done here for example https://github.com/SvenskaSpel/locust-plugins/blob/bf4097eb3a04580de886b5b138151a6b0d21660e/locust_plugins/__init__.py#L209 |
Feature request
Setup method like
unittest
Expected behavior
Method
on_start
only run once, but my testcase require different parameter recieved from an HTTP response.If I get this variable with
on_start
, then only first test can pass; and if I call theget_parameter
method in testcase, it will makes testresult inaccurate for the time waiting for response.Actual behavior
Is there any method like
setup
withunittest
(I didn't find in document), or any suggests that can solve this scene?The text was updated successfully, but these errors were encountered: