Warning Work In Progress
Response from BrowserStack support.
Please find the findings of our engineering team below: Error_1: Disconnected reconnect failed before timeout of 2000ms : sample GitHub build shared by you where this error can be seen https://github.com/twbs/bootstrap/runs/7120175035?check_suite_focus=true We were able to reproduce this error and able to fix it as well. By increasing the timeout value from 2000 to something higher like 60000 for the karma config variable browserDisconnectTimeout . This variable can be seen in node_modules/karma/lib/config.js file.
Would also recommend to modify the following fields to improve the robustness of tests, these numbers can be experimented with by you, eg:
browserDisconnectTimeout: 60000
pingTimeout: 10000, // default is 5 secs, can change this to 10 secs
browserDisconnectTolerance : 3, // default is 0 attempts, can change this to 3 attempts
browserNoActivityTimeout : 210000