I am running UI tests using NightwatchJS v 1.1.11 and Selenoid
selenoid is hosted on a t2.micro EC2 instance(evaluation phase hence using t2.micro).
Tests randomly fail in the middle of tests for 2 main reasons:
1) socket hang up exceptions
13:10:05 tests/readOnlyProduction/palette.js POST http://xx.xx.xx.xx:4444 /wd/hub/session/87f6eb1b0b3369ba93bb9ce8c548fa89/element/0.46204216593315195-1/click - ECONNRESET
13:10:05 tests/readOnlyProduction/palette.js Error: socket hang up
13:10:05 tests/readOnlyProduction/palette.js at createHangUpError (_http_client.js:342:15)
13:10:05 tests/readOnlyProduction/palette.js at Socket.socketCloseListener (_http_client.js:377:23)
13:10:05 tests/readOnlyProduction/palette.js Error while running .clickElement() protocol action: An unknown error has occurred.
2) session timed out or not found
13:11:06 tests/readOnlyProduction/palette.js Error while running .locateMultipleElements() protocol action: Session timed out or not found
Tests are being triggered from Jenkins running against selenoid in EC2 but similar exceptions are observed when selenoid is hosted in local and tests are triggered in local.
Most importantly, this happens when tests are run in parallel while same tests works fine when run one at a time.
So far tried following, but no luck so far.
1) Adding this in nightwatch.json
"request_timeout_options": { "timeout": 100000, "retry_attempts": 3 }
2) I had lots of test cases inside single test suite, so broke into smaller tests.
Say, there is a network issue, then where would those be logged? I do not have any information yet to confidently say, there is network issue. – srinathbharadwaj Aug 05 '19 at 16:56