@zered,
I actually locked each appium process to the phone in test with arguments that seemed to work for selenium-grid. This way the instance is directly linked to the udid in the node config file and the process is specificaly told to use that udid phone.
node node_modules/appium/build/lib/main.js --nodeconfig /Users/jenkins/build_tools/android_phone/ce0117115d312d2705/selenium-conf.json --session-override --device-name ce0117115d312d2705 --udid ce0117115d312d2705 --port 4823 --callback-port 4824 --log-timestamp --debug-log-spacing
The nodeconfig file looks like this:
{
"capabilities":
[
{
"version": "7.0",
"maxInstances": 1,
"platform": "Android",
"hostname": "myhostname",
"port": "4823",
"deviceName": "ce0117115d312d2705",
"maxInstances": 1,
"udid": "ce0117115d312d2705",
"start": "2018-03-26T16:01:38-0400"
}
],
"configuration":
{
"cleanUpCycle":2000,
"timeout":300000,
"url":"http://myip:4823/wd/hub",
"host": "myip",
"port": 4823,
"maxSessions": 1,
"register": true,
"registerCycle": 5000,
"hubPort": 4444,
"hubHost": "huphost.ip"
}
}