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

Exception throws on attempt to report request results to master #1293

Closed
eduardrudko opened this issue Mar 20, 2020 · 2 comments
Closed

Exception throws on attempt to report request results to master #1293

eduardrudko opened this issue Mar 20, 2020 · 2 comments
Labels

Comments

@eduardrudko
Copy link

#899 # Describe the bug
Hi all, i'm currently trying to use locust with java client in distributed mode. I have wrote a simple custom task that sends GET request to version. The approach i'm using described here: https://www.blazemeter.com/blog/locust-performance-testing-using-java-and-kotlin/
So problem i'm struggling with is that when the following line is executed:
Locust.getInstance().recordSuccess(String requestType, String name, long responseTime, long contentLength);
or
Locust.getInstance().recordFailure(String requestType, String name, long responseTime, String error

The Locust master node throwing an exception and states the following:
[2020-03-20 07:59:40,262] 5e94371d5d92/INFO/locust.util.exception_handler: Exception found on retry 1: -- retry after 1s

I'm running locust in docker and i've tried different versions of Python and Locust master.
The most stable combination i've found is Python 3.6 + Locustio 0.11.0

Here is the full log:
docker run -ti -p 5557:5557 -p 8089:8089 locust
[2020-03-20 07:46:10,978] 5e94371d5d92/INFO/locust.main: Starting web monitor at *:8089
[2020-03-20 07:46:10,991] 5e94371d5d92/INFO/locust.main: Starting Locust 0.11.0
[2020-03-20 07:59:22,425] 5e94371d5d92/INFO/locust.runners: Client 'macbook0258_226e0d2986be793d6ac910f36f141a4c' reported as ready. Currently 1 clients ready to swarm.
[2020-03-20 07:59:37,413] 5e94371d5d92/INFO/locust.runners: Sending hatch jobs to 1 ready clients
[2020-03-20 07:59:40,262] 5e94371d5d92/INFO/locust.util.exception_handler: Exception found on retry 1: -- retry after 1s
[2020-03-20 07:59:43,269] 5e94371d5d92/INFO/locust.util.exception_handler: Exception found on retry 1: -- retry after 1s
[2020-03-20 07:59:46,272] 5e94371d5d92/INFO/locust.util.exception_handler: Exception found on retry 1: -- retry after 1s
[2020-03-20 07:59:49,281] 5e94371d5d92/INFO/locust.util.exception_handler: Exception found on retry 1: -- retry after 1s
[2020-03-20 07:59:52,254] 5e94371d5d92/INFO/locust.util.exception_handler: Exception found on retry 1: -- retry after 1s
[2020-03-20 07:59:55,261] 5e94371d5d92/INFO/locust.util.exception_handler: Exception found on retry 1: -- retry after 1s
[2020-03-20 07:59:58,267] 5e94371d5d92/INFO/locust.util.exception_handler: Exception found on retry 1: -- retry after 1s

Expected behavior

The request results should have been recorded and displayed on UI

Actual behavior

The request results have not been recorded and exception thrown.

Steps to reproduce

  1. Implement simple custom task using the instructions described https://www.blazemeter.com/blog/locust-performance-testing-using-java-and-kotlin/
  2. In custom task send some simple request and record results
  3. Setup Locust master and run the following command : locust -f locust-master.py --master --master-bind-host=127.0.0.1 --master-bind-port=5557
  4. Check heartbeat on Locust masters output
  5. Goto UI and run performance.

Environment

  • OS: macOS Mojave : 10.14.6
  • Python version: python:3.6.8
  • Locust version: 0.11.0
  • Locust command line that you ran: locust -f /locust-master.py --master --master-bind-host=0.0.0.0 --master-bind-port=5557
  • Locust file contents (anonymized if necessary):
    from locust import Locust, TaskSet, task
    class DummyTask(TaskSet):
    @task(1)
    def dummy(self):
    pass
    class Dummy(Locust):
    task_set = DummyTask

Also i'm using locust4j lib https://github.com/myzhan/locust4j - 1.0.8

P.S.
I've tried different approaches, local run, docker, different Python versions, Locust versions, Locust4j versions and OS types, Including Windows 10 and have no ideas anymore whats wrong.

@heyman
Copy link
Member

heyman commented Mar 20, 2020

Locust has no official Java client, so this should maybe be an issue in the locust4j repo.

@eduardrudko
Copy link
Author

Hi @heyman thanks for answer.
Posting this issue to locust4j repo, if someone struggle with the same please refer to: myzhan/locust4j#16

Closing this one.

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