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 maste #16

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

Exception throws on attempt to report request results to maste #16

eduardrudko opened this issue Mar 20, 2020 · 4 comments

Comments

@eduardrudko
Copy link

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
Implement simple custom task using the instructions described https://www.blazemeter.com/blog/locust-performance-testing-using-java-and-kotlin/
In custom task send some simple request and record results
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
Check heartbeat on Locust masters output
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
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.

@myzhan
Copy link
Owner

myzhan commented Mar 20, 2020

You can use locust4j 1.0.9, to work the latest locust master. Because locust changed the data protocol.

@eduardrudko
Copy link
Author

Hi @myzhan thank you for your response. The exception throws even on 1.0.9 locust4f version.
Any ideas what else could be the problem?

@myzhan
Copy link
Owner

myzhan commented Mar 20, 2020

Try to modify the local copy of exception_handler.py, and use traceback to print out the stack.

@eduardrudko
Copy link
Author

Fixed by using the docker image https://hub.docker.com/r/swernst/locusts and version of locust 0.11.0

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

2 participants