I have my Selenium Java tests running inside a Docker container. I need to use BrowserStackLocal, because I use BrowserMob proxy to intercept and check the analytics sent by our web App. Each time there is a call to BrowserStackLocal.stop() inside Docker - it just hangs. When I connect to this running container, I see this:
# ps -eo pid,ppid,state,cmd | awk '$3=="Z"'
63 1 Z [BrowserStackLoc] <defunct>
I came across the following issue for NodeJS, but apparently it was not ported to Java implementation: https://github.com/browserstack/browserstack-local-nodejs/issues/25
I'm fine with a workaround, but I have tried the following combinations inside my Dockerfile (using a workaround from similar issue with browserstack-local-nodejs) to no avail:
CMD ["java", "-cp", "target/.jar", "org.testng.TestNG", "testng.xml"]
CMD ["/bin/bash", "-c", "set -e && java -cp .jar org.testng.TestNG testng.xml"]
the only thing works is commenting the browserStackLocal.stop() call. Is there a workaround that might help?