Running tests in parallel causes android bootstrap socket crash

I am running three different appium servers with the following command

appium --address 127.0.0.1 -p 4923 -U 0815f8ab2d9c0f04 -bp 4945 --chromedriver-port 4977 --session-override

appium --address 127.0.0.1 -p 4835 -U 32048bee42301293 -bp 4857 --chromedriver-port 4877 --session-override 

appium --address 127.0.0.1 -p 4747 -U LGH8159ea5948a -bp 4769 --chromedriver-port 4777 --session-override 

Then i use testng to execute different test cases on each real device. However, 10 minutes into the test cases i get the following error on two of the servers. The third server contineus to work normally.

Error: Android bootstrap socket crashed: Error: read ECONNRESET
at Socket. (lib/bootstrap.js:87:21)
at Socket.emit (events.js:107:17)
at net.js:459:14
at process._tickCallback (node.js:355:11)

I have updated appium to latest version with npm update -g appium

Please help as I have been stuck on this issue for over a week. I believe there may be a bug where appium is not correctly forwarding the bootstrap port.

@jackbasmajian

Not sure it can solve the issue. But anyway, please give a try as below configuration.

Try to add flag when starting the Appium Server [–no-reset]
(if you are not trying to install the app every single test)

Device 01:
appiumPort = 4725
bootStrspPort = 2295
chromePort = 6005

Device 02:
appiumPort = 4726
bootStrspPort = 2296
chromePort = 6006

Device 03:
appiumPort = 4727
bootStrspPort = 2297
chromePort = 6007