Locust executor
I need the ability to run distributed Locust with master and multiple workers that communicate with one another. I tried creating it using container executor but faced some issues with the custom job-template. Furthermore, I want it to be one test and with a custom container executor, I will have to create 2 tests - one for the master and one for the worker. Can you please consider adding it as an executor?
Thank you, @yarden-slon. Looks like an interesting request. Let @TheBrunoLopes to follow you for details. Sounds like we need to understand better the desired flow
@TheBrunoLopes need to be discussed
Hi. Any update regarding this request? I also need this exactly same feature
HI @teixeira-fernando - thanks for reaching out! This should be doable with the new Workflows engine - have you looked at https://docs.testkube.io/articles/test-workflows-parallel ? If you're not exactly sure how to set it up - could you provide us with a public github repo containing a simple locust test that we can use to try to create an example for you? thanks in advance!
Hi! In case of Locust, it's actually Services that would support the master/slave communication. We don't have Locust example there, but you can get inspired by JMeter example.
Actually, Locust looks a bit different than JMeter - the workers are connecting to the master node, so either the master needs to be started before the workers, or at least needs to have a known address before.
Cc: @tkonieczny, as I have idea of "workarounds" to handle it (i.e. headless service), but I'm not sure if that's proper, and additionally it may match a bit our latest discussions about services features.
Yes, exactly. I was able to create a simple test workflow working on headless mode, but I just have my master node. I still need to find a way to properly have the worker nodes in this same configuration to distribute my load. Here is my example file if you want to have a look:
kind: TestWorkflow
apiVersion: testworkflows.testkube.io/v1
metadata:
name: locust-sample-copy
namespace: testkube
labels:
app.kubernetes.io/name: my-api
app.kubernetes.io/part-of: my-cms
testkube.io/test-category: load-test
testkube.io/test-tool: locust
spec:
content:
files:
- path: locustfile.py
content: "from locust import HttpUser, task\n\nclass User(HttpUser): \n @task
\n def get_employees(self) -> None:\n \"\"\"Get a new fact\"\"\"\n
\ self.client.get(\"/fact\")\n"
container:
workingDir: /data
steps:
- name: Run locust tests
run:
image: locustio/locust
shell: locust --host https://catfact.ninja --headless --users 100 --spawn-rate
3 --run-time 60s --html=report.html
status: {}
I prepared some examples (including distributed) here: https://github.com/kubeshop/testkube/pull/6053
Thanks @tkonieczny . That helps a lot 👍🏻