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

'Tasks' section remains empty for html on v 2.7.0 #1994

Closed
eliezershindler opened this issue Feb 3, 2022 · 14 comments
Closed

'Tasks' section remains empty for html on v 2.7.0 #1994

eliezershindler opened this issue Feb 3, 2022 · 14 comments

Comments

@eliezershindler
Copy link

I found this to be working on v2.5.1 but on 2.7.0, the 'tasks' section remains empty in the html report generated remains empty:
image

@cyberw
Copy link
Collaborator

cyberw commented Feb 3, 2022

@tyge68 Could I bother you to have a look?

@tyge68
Copy link
Contributor

tyge68 commented Feb 3, 2022

@cyberw it works for me on the 2.7.1
Screenshot 2022-02-03 at 14 58 35

@eliezershindler Can you please retry with latest 2.7.1 ? if that still occurs, you could please provide more details how to reproduce it ?

@eliezershindler
Copy link
Author

It is still happening for me. Note I'm talking about the html file that is defined in locust.conf as html = results.html. It's a static file. I'm running a test from the command line, not looking at the web UI. The conf file looks like:

locustfile = locustfile.py
headless = true
users = 1
spawn-rate = 1
run-time = 300s
html = results.html
only-summary = true
csv = results.csv

I define the host elsewhere. When I open up the file in chrome, the 'Tasks' section is empty. Also tried Safari:
image

@tyge68
Copy link
Contributor

tyge68 commented Feb 4, 2022

@eliezershindler so it's the offline report that is not working, I see it tries to get the tasks from the locust server, while it actually have the information in the HTML already. Not sure why it was then working already in the past.
Anyway the solution would be to load it from the data-tasks attribute

@eliezershindler
Copy link
Author

@tyge68 was that directed at me? If so, could you elaborate what the data-tasks attribute is?

@tyge68
Copy link
Contributor

tyge68 commented Feb 4, 2022

@eliezershindler I see this issue was introduced by this PR (1), @EzR1d3r do you remember why you had to change from initTasks to updateTasks ? it now doesn't work anymore in context of "saved" reports.

@cyberw would it be ok to store a constant in the report.html so it could be used to define if that is using static data from DOM or read from /tasks ?

Eventually a try .. catch around the get , and fallback to previous solution should also work.

(1) 6eeb5b8

tyge68 added a commit to tyge68/locust that referenced this issue Feb 4, 2022
@tyge68
Copy link
Contributor

tyge68 commented Feb 4, 2022

I have opened a PR in order to resolve it, @eliezershindler you can use the branch (1) eventually to validate it works for you too.

(1) https://github.com/tyge68/locust/tree/issue/%231994

@EzR1d3r
Copy link
Contributor

EzR1d3r commented Feb 4, 2022

do you remember why you had to change from initTasks to updateTasks ? it now doesn't work anymore in context of "saved" reports.

The changes were due to the fact that ratio have to be calculated dynamically (since the functionality of users with fixed_count makes ratio calculation meaningful only based on the current number) and in the web interface they are updated as users spawn. I tried to describe it in the commit.

@EzR1d3r
Copy link
Contributor

EzR1d3r commented Feb 4, 2022

I see it tries to get the tasks from the locust server, while it actually have the information in the HTML already

I'll try to reproduce this bug. It seems to me that I saw a dummy, the purpose of which I did not understand then, perhaps it is possible to correct the wrong behavior through python-code.

cyberw added a commit that referenced this issue Feb 4, 2022
#1994 Fixing to fallback in case of local execution
@cyberw
Copy link
Collaborator

cyberw commented Feb 4, 2022

Hmm.. I merged the PR before seeing your comments @EzR1d3r . If there is a more appropriate solution, let me know.

@EzR1d3r
Copy link
Contributor

EzR1d3r commented Feb 5, 2022

Hmm.. I merged the PR before seeing your comments @EzR1d3r . If there is a more appropriate solution, let me know.

Sure. I'll make a fix soon, more so I found the ratio data is not complete anyway in 'post report'. I didn't know about this feature and didn't check it.

@eliezershindler
Copy link
Author

eliezershindler commented Feb 6, 2022

Is this supposed to work now? It's not working for me on 2.7.2
image

@tyge68
Copy link
Contributor

tyge68 commented Feb 6, 2022

@eliezershindler the fix was merged 2 days ago, 2.7.2 was released 3 days ago.
So it's not included, you can simply install locust from the git url directly if you like to try it. (pip install <git url>)

@eliezershindler
Copy link
Author

confirmed working on 2.7.3 thanks

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

No branches or pull requests

4 participants