2

When using --headless=new in my tests they use way more CPU, compared to old headless mode.

Watching the task manager I noticed that even for one test it opens multiple Chrome instances. My tests need headless new to function but I can't run the whole feature because it kills my laptop.

Is there any way to optimize the CPU usage?

Using Serenity-BDD This is my setup for options:

chrome.switches=--headless=new;--disable-dev-shm-usage;--no-sandbox;--disable-download-notification;--test-type;--ignore-certificate-errors;--disable-popup-blocking;--disable-default-apps;--disable-extensions-file-access-check;--start-maximized;--incognito;--disable-infobars,--disable-gpu

headless.mode = true, works fine with CPU but can't download files or right click and copy text --headless=new, kills the laptop, tests work while running them one by one

zforgo
  • 2,508
  • 2
  • 14
  • 22
  • I think the issue could be with binaries used in both modes. The old headless mode uses a separate alternate binary which supposedly uses fewer system resources, the new headless mode uses regular Chrome binary but doesn't display any windows. So, I think the regular Chrome version just requires more resources. Try to run your test(s) without headless mode and compare resource usage. https://developer.chrome.com/articles/new-headless/ – Ilya Lapitan May 04 '23 at 03:27
  • @IlyaLapitan without headless mode it works fine, with no problems – Tamas Demeny May 04 '23 at 09:08

0 Answers0