1

Having already run some promising experiments with Karate-Gatling, we wanted to take it to the next level with Distributed Load Testing across multiple Kubernetes pods and clusters. Following the docs, I tried to explore the karate-gatling-demo and espacially the GatlingDockerJobRunner.

But with the current versions (since v1.2.0) I don't get the code successfully built. No matter which command, mvn clean test, mvn gatling:test or even mvn gatling:test -Dtest=jobtest.GatlingDockerJobRunner - they always return:

Could not resolve dependencies for project com.intuit.karate.examples:examples-gatling:jar:1.0-SNAPSHOT: Failure to find com.intuit.karate:karate-gatling:jar:1.0-SNAPSHOT in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced

Up to v1.1.0, on the other hand, it works on my machine (Ubuntu 20.04 inside Windows 11 WSL2). Seems like the pom.xml is currently no longer valid?

Edit:

BTW: The docs for this example seems very sparse to me, which may be part of the reason why other people (see here) find it difficult to get into. The Maven commands for quick trial don't seem to be documented at all.

Drunda Nibel
  • 101
  • 6

1 Answers1

1

Ok, my mistake. Since v1.2.0 you have to hard overwrite the ${karate.version} variable with the correct value in the pom.xml to build the example:

    <!-- please change this when running locally -->
        <karate.version>${project.version}</karate.version>

But one question remains:

How do I run the GatlingDockerJobRunner example correctly? The command mvn gatling:test -Dtest=jobtest.GatlingDockerJobRunner does not seem to be right. Because I would expect it to start up worker nodes in Docker containers, which is not the case.

Edit:

In the above-mentioned post on distributed Karate-Gatling tests, the questioner had found out for himself in a later comment that he could use this command: mvn exec:java -Dexec.mainClass="jobtest.GatlingDockerJobRunner" -Dexec.classpathScope="test".

In fact, this will launch two karate-chrome containers (the workers?). However, this repeatedly throws errors of this type:

ERROR com.intuit.karate - java.net.UnknownHostException: host.docker.internal: Name or service not known, http call failed after 35 milliseconds for url: http://host.docker.internal:38287/healthcheck

And several minutes later, the process hangs at some point printing exit status 1; not expected (without terminating and shutting down the containers):

22:31:30.110 [1677965423107-out] DEBUG com.intuit.karate - 21:31:30.109 [main]  ERROR com.intuit.karate - unable to connect to server, aborting
22:31:30.120 [1677965423107-out] DEBUG com.intuit.karate - 2023-03-04 21:31:30,120 INFO exited: karate (exit status 1; not expected)
22:31:30.169 [1677965423107-out] DEBUG com.intuit.karate - 21:31:30.167 [main]  ERROR com.intuit.karate - unable to connect to server, aborting
22:31:30.190 [1677965423107-out] DEBUG com.intuit.karate - 2023-03-04 21:31:30,189 INFO exited: karate (exit status 1; not expected)

Given the lack of hints, I wonder if this error pattern is part of the experimental status of the whole approach that I have to accept, or if I am still doing something wrong?

Drunda Nibel
  • 101
  • 6
  • we would welcome code contributions on github – Peter Thomas Mar 07 '23 at 14:19
  • But how could I, when I don't even know and understand how the existing one is intended to be used? Don't misunderstand, I would be very happy to help improve where I can. I think the potential of this (distributed) performance testing approach is completely underestimated in user perception so far. But unfortunately also given away. – Drunda Nibel Mar 07 '23 at 14:29
  • I agree. I wish more people used it and contributed better docs and closed the gaps. karate has a lot in it, it is just that hard to make sure everything gets the same priority. we focus on the most commonly used features, I'm sure you will understand – Peter Thomas Mar 07 '23 at 14:34