Locust: Report charts plot data points after the test has ended

Created on 19 Jan 2021  路  1Comment  路  Source: locustio/locust

imagen
imagen

Describe the bug

After stopping a test on the UI, when I click on "Download report" the plots show a date range between _test-start_ and _now_, instead of _test-start_ and _test-end_.

Expected behavior

All the plots should only contain data between _test-start_ and _test-end_ dates I guess.

Actual behavior

All three plots in the report continue plotting either 0 (Response Times and Number of Users) or RPS (Total Requests per Second) after the test has ended up until the moment you open or refresh the Download Report page.

Steps to reproduce

  • Start the UI with any test file (the Quick Start one for example: https://docs.locust.io/en/stable/quickstart.html): locust -f example.py
  • Parameters don't matter as far as I know, just run the test
  • Let it run for a few seconds
  • Stop it
  • Wait for 10 or 20 seconds so it is easier to see the bug
  • Click on Download Data -> Download Report
  • Notice the flatlines on the plots and the date ranges, extending way after the test was stopped. If you refresh this page (the report) the plots just keep growing.
  • Interestingly enough, the start and end dates at the top of the report are correct

Environment

  • OS: Ubuntu 20.04
  • Browser: Firefox 84.0.2 and Chromium 87.0.4280.141
  • Python version: 3.8.5
  • Locust version: 1.4.1
  • Locust command line that you ran: locust -f example.py
  • Locust file contents (anonymized if necessary):
import time
from locust import HttpUser, task

class QuickstartUser(HttpUser):
    @task
    def hello_world(self):
        self.client.get("/hello")
        self.client.get("/world")

    @task(3)
    def view_item(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"})

BTW I think this is a great tool, I have just discovered it and I am loving it! :heart:

bug

Most helpful comment

I'm agree with you. 馃憤
Let me review the code, maybe I could make a PR to solve this. Also I don't like that charts data disappear after a page refresh but it properly show up when you generate the test report

>All comments

I'm agree with you. 馃憤
Let me review the code, maybe I could make a PR to solve this. Also I don't like that charts data disappear after a page refresh but it properly show up when you generate the test report

Was this page helpful?
0 / 5 - 0 ratings

Related issues

styk-tv picture styk-tv  路  3Comments

ashleigh-robinson picture ashleigh-robinson  路  3Comments

gboorse picture gboorse  路  3Comments

max-rocket-internet picture max-rocket-internet  路  3Comments

dolohow picture dolohow  路  3Comments