How to fix – Chrome Headless – ERROR Disconnected because no message in 30000 ms.
June 25, 2023 2023-06-28 4:02How to fix – Chrome Headless – ERROR Disconnected because no message in 30000 ms.
Google Chrome Headless browser is an open source and great tool for automated testing for QA team where you don’t need a visible UI shell.
In the Jenkins pipeline sometime you may received the error below when running the Unit test case with Google Chrome Headless.
Disconnected (1 times), because no message in 30000 ms. HeadlessChrome 0.0.0 (Linux 0.0.0) ERROR Disconnected. This post will helps you how to fix this problem.
The sample error on the Jenkins console page,
14 03 2023 08:33:36.724:WARN [launcher]: ChromeHeadless was not killed in 2000 ms,
sending SIGKILL.
15 03 2023 08:33:52.414:INFO [karma]: Karma v3.0.0 server started athttp://0.0.0.0:9876/
15 03 2023 08:33:52.445:INFO [launcher]: Launching browser ChromiumHeadlessConfigured with unlimited concurrency
15 03 2023 08:33:52.348:INFO [launcher]: Starting browser ChromeHeadless
15 03 2023 08:34:36.084:INFO [HeadlessChrome 0.0.0 (Linux 0.0.0)]: Connected on socket bWQDT9taY4WS0BRjAAAB with id 21832231
15 03 2023 08:35:06.011:WARN [HeadlessChrome 0.0.0 (Linux 0.0.0)]: Disconnected (1 times), because no message in 30000 ms. HeadlessChrome 0.0.0 (Linux 0.0.0) ERROR Disconnected, because n
Open the karma.conf.js file and add or change the lines from the lines below and try it one more time 🙂
captureTimeout: 300000,
browserDisconnectTolerance: 3,
browserDisconnectTimeout : 300000,
browserNoActivityTimeout : 300000,
Once you saved the file, then run the Jenkins job or pipline again.