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

HTML Report cannot be displayed #2704

Open
2 tasks done
borget opened this issue May 6, 2024 · 5 comments
Open
2 tasks done

HTML Report cannot be displayed #2704

borget opened this issue May 6, 2024 · 5 comments
Labels

Comments

@borget
Copy link

borget commented May 6, 2024

Prerequisites

Description

The HTML report cannot be displayed on the browser for downloading, when a large number of failure/exception are present in the test.

  1. Run a test with a high volume of failures
  2. After the test is completed
  3. Go to DOWNLOAD DATA tab and click Download Report
  4. A blank page is displayed and the content cannot be displayed.
Screenshot 2024-05-06 at 10 16 43 Screenshot 2024-05-06 at 10 14 18 Screenshot 2024-05-06 at 10 19 50

It would be great if a max default value can be set here

https://github.com/locustio/locust/blob/master/locust/html.py#L108

So the page does not try to load tons of failures/exceptions that crashes the UI

Command line

-f my_test.py --autostart --modern-ui

Locustfile contents

class FastUser(FastHttpUser):
    tasks = [FastUserTasks]


class FastUserTasks(TaskSet):
    @tag("Task1")
    @task(1)
    def task1(self):
        """
        I omitted how below variables are generated. Overall, there is some logic that generates protobuf messages
        that are sent as binary over http post action when executing the tasks.
        """
        self.client.post(
            url,
            name=f"/{message_type}",
            data=message,
            headers={
                "Content-Type": "application/octet-stream"
            }
        )

Python version

3.11

Locust version

2.24.0

Operating system

MacOS

@borget borget added the bug label May 6, 2024
@cyberw
Copy link
Collaborator

cyberw commented May 6, 2024

Please re-test using latest version (2.27.0)

@borget
Copy link
Author

borget commented May 6, 2024

Please re-test using latest version (2.27.0)

Hi @cyberw,

Thanks for the suggestion,

I upgraded and tested locally,

It got unresponsive around 60K failures,

In my opinion, I would like to disable showing failures/exceptions or at least set a default num of items, I do not see much value on trying to render all rows in the report, it turns into a really big scrollable page that cannot be easily navigated,

Thanks!

Screenshot 2024-05-06 at 12 14 59

@cyberw
Copy link
Collaborator

cyberw commented May 6, 2024

Ah, I didnt read your report closely.

The problem is with unique error messages, right?

I’ll look into this. Perhaps we can do something on the UI side as well, but we could/should probably group any new exceptions after 1000 unique ones as just ”other” or something.

For now you should be able to do this manually by just setting the error message to something less unique.

@borget
Copy link
Author

borget commented May 6, 2024

Ah, I didnt read your report closely.

The problem is with unique error messages, right?

I’ll look into this. Perhaps we can do something on the UI side as well, but we could/should probably group any new exceptions after 1000 unique ones as just ”other” or something.

For now you should be able to do this manually by just setting the error message to something less unique.

That's a great idea, thanks for looking into it

Can you please point me to the docs/code on how to set a the error, to avoid producing tons of them?

right now I am not catching the exception, so I am doing

        self.client.post(
            url,
            data=message,
            headers={
                "Content-Type": "application/octet-stream"
            }
        )

@cyberw
Copy link
Collaborator

cyberw commented May 6, 2024

Use catch_response=True and response.failure(”something went wrong, but lets keep the error message the same for all”) as documented here:

https://docs.locust.io/en/stable/writing-a-locustfile.html#validating-responses

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

No branches or pull requests

2 participants