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

Locust stuck in "Shape worker starting" when restarting a test from the webUI #1540

Closed
ancameme opened this issue Aug 21, 2020 · 2 comments · Fixed by #1541
Closed

Locust stuck in "Shape worker starting" when restarting a test from the webUI #1540

ancameme opened this issue Aug 21, 2020 · 2 comments · Fixed by #1541
Labels

Comments

@ancameme
Copy link

ancameme commented Aug 21, 2020

When restarting a test (that uses LoadTestShape) from the webUI, the test gets stuck in "Shape worker starting" (until tick() signals another change in shape).

Expected behavior

Test should start immediately without waiting on a change in load shape.

Actual behavior

Test waits on a change in load shape

Example file:

import datetime
from locust import HttpUser, TaskSet, task, constant
from locust import LoadTestShape

class UserTasks(TaskSet):
    @task
    def something(self):
        self.client.post(f'/')

class WebsiteUser(HttpUser):
    wait_time = constant(1)
    tasks = [UserTasks]

class upAndDown(LoadTestShape):
    def tick(self):
        if datetime.datetime.now().minute % 2 == 0:
            user_count = 4
        else:
            user_count = 5
        return (user_count, 2)

Start test then stop. Restart the test from webUI (New test). The test won't start running until the minute changes (and tick() returns a different user_count).

Seems to be due to

            elif self.shape_last_state == new_state:
                gevent.sleep(1)

in runners.py > Runner > shape_worker

and self.shape_last_state = None not being reset in stop()

  • Python version: 3.6.9
  • Locust version: 1.2.1
@ancameme ancameme added the bug label Aug 21, 2020
@max-rocket-internet
Copy link
Contributor

max-rocket-internet commented Aug 21, 2020

True.

Are you able to make a PR?

@ancameme
Copy link
Author

ancameme commented Aug 21, 2020

@max-rocket-internet Sorry, no

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

Successfully merging a pull request may close this issue.

2 participants