I have run into this before and we fixed it in the README
but not in this script (I wasn't using this script at the time)
This was changed in the README in change:
I85a9e7dbd9a66418c85585969adb5ac1548f5ef6
Bug: T182421
Change-Id: I6ab92c6a61a57dc313b05321d0789dcbeb776c94
# Check the command before running in background so
# that it can actually fail and have a descriptive error
hash chromedriver
-chromedriver --url-base=/wd/hub --port=4444 &
+chromedriver --url-base=wd/hub --port=4444 &
CHROME_DRIVER_PID=$!
echo chromedriver running with PID $CHROME_DRIVER_PID
# Make sure it is killed to prevent file descriptors leak