Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

If Karma finishes the tests but your command never returns, first identify which process is still alive. “ChromeHeadless not exiting” can mean Chrome never captured, Chrome exited but Karma did not, or Karma stopped while a Node process, reporter, build wrapper, or CI shell kept running. Set singleRun: true for a one-shot run, then use the last lifecycle message in a debug log to choose the correct fix. Raising a timeout without locating the stalled stage rarely solves the problem.

Start by locating the stalled lifecycle stage

Run the identical command locally and in CI with debug logging enabled by your framework and Karma setup. Save the complete output and mark these events:

  • Chrome or Chromium launches.
  • The browser is captured and connects to Karma.
  • Tests execute and finish.
  • The browser disconnects and its launcher process exits.
  • Karma emits its stop or exit event.
  • The shell, CI job, container, or outer build command returns.

The last event you can prove is more useful than the phrase “it hangs.” If there is no capture event, follow the startup branch. If tests finish and Chrome exits, investigate Node-side handles and the CI wrapper instead of browser capture settings.

Make sure the run is actually one-shot

Karma’s singleRun setting is its CI mode: it starts and captures configured browsers, runs tests, then exits with status 0 or 1 according to the test result. A watch run intentionally keeps the process alive for another change.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Philips 24 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 241V8LB
  • CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
  • WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
  • A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents

Karma configuration

module.exports = function (config) {
  config.set({
    singleRun: true,
    browsers: ['ChromeHeadless'],
    frameworks: ['jasmine'],
    reporters: ['progress']
  });
};

Direct CLI invocation

npx karma start --single-run --browsers ChromeHeadless

The command above is a model, not a guarantee that every framework CLI uses the same options. Angular’s ng test, another framework command, or a generated configuration can merge or override Karma settings. Inspect the command used by CI, the configuration file it loads, and the effective browser and watch settings. If a wrapper starts a second watcher or leaves a development server open, Karma’s successful exit will not end the job.

If ChromeHeadless never captures

A capture failure occurs before the suite can run. Karma 3.0 documentation describes a 60,000 ms browser-capture timeout and retries before giving up; Karma 6.4 documents a 20,000 ms browser socket timeout. Those are versioned documentation values, not universal defaults for every dependency combination. Check the versions installed in the failing environment before changing them.

Verify the executable

  • Print the Chrome/Chromium version in the same user, container, and PATH used by CI.
  • Confirm that the executable is present and can start without a display server in the container.
  • Check Chrome stderr for sandbox, missing-library, profile-lock, or permission errors.
  • Compare the local and CI values of CHROME_BIN.

karma-chrome-launcher supports ChromeHeadless and ChromiumHeadless variants, reads CHROME_BIN, and documents using Puppeteer’s executable path as an alternative source of Chromium. A custom launcher can add flags required by your environment, but flags solve launch conditions; they do not explain a Node process that remains after a successful test run.

Change capture timeouts only for proven slow startup

If logs show Chrome eventually starts and connects, increase the relevant capture or socket timeout in the installed Karma version and record the before/after log. Do not use a larger capture timeout to treat a post-test hang: once the browser is captured, that timeout is no longer the active stage.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Philips 22 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 221V8LB
  • CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
  • SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors

If tests finish but the command remains alive

Look for both the launcher process exit and Karma’s stop event. Karma’s processKillTimeout is the wait before it sends SIGKILL when a browser has not terminated after a test run or kill attempt; documented Karma 3.0 and 6.4 values are 2,000 ms. It governs browser termination escalation, not every resource held by Node or a CI wrapper.

Inspect the remaining process

  1. Capture a process tree after the final test result appears. Determine whether the parent is Chrome, the Karma Node process, a reporter, a coverage tool, a framework CLI, or the CI shell.
  2. Inspect active Node handles in a diagnostic reproduction. File watchers, open sockets, child processes, timers, report writers, and coverage streams are common categories to check.
  3. Run the same test with coverage, reporters, and project orchestration disabled one at a time. Keep the smallest passing command as your baseline.
  4. Check that report and coverage destinations are writable and that their streams close after writing.

Do not treat these categories as a confirmed cause in every project. They are hypotheses to verify against your process tree and logs. A historical 2022 Angular/GitLab/Kubernetes report showed browser termination, report writing, Karma’s stop event, and proxy cleanup before the apparent hang; it therefore points toward an environment-specific process or handle rather than proving a universal Angular or GitLab defect.

Use processKillTimeout narrowly

Change this value only when the logs show that the Chrome process itself is slow to terminate. Keep the change small and test one setting at a time. If Chrome has already exited and Karma has emitted its stop event, changing this value cannot close a reporter, watcher, open socket, or outer shell.

Why CI fails while local runs exit

A CI-only symptom demonstrates a difference in environment, not a diagnosis. Compare these items from the working and failing runs:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Dell 24 Monitor - SE2426H - 23.8-inch FHD (1920x1080) 144Hz 1ms Display, in-Plane Switching (IPS) Technology, AMD FreeSync™, TÜV 3-Star 2X HDMI, Tilt
  • Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
  • Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
  • Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
  • In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
  • Ultra-thin bezels: Maximize your viewing experience with thin bezels.
Area Compare What it can reveal
Runtime Node version, OS image, container user, process limits Different signal, permission, or child-process behavior
Browser Chrome/Chromium version, path, flags, sandbox policy Launch or shutdown differences
Packages Karma, karma-chrome-launcher, framework CLI, Puppeteer Changed defaults or launcher behavior
Configuration Merged Karma config, reporters, coverage, watch flags An unintended persistent mode or plugin
Orchestration Shell script, npm lifecycle, proxy, build tool, CI agent A process outside Karma retaining the job

Reproduce in the same container image where possible. Remove one layer at a time while preserving a passing test command, and retain the log delta for each change. This approach distinguishes a browser problem from a wrapper problem without masking the evidence with a global timeout.

Common symptoms and targeted fixes

“ChromeHeadless have not captured”

This wording indicates that Karma did not receive a browser connection. Check the executable, required shared libraries, sandbox permissions, CHROME_BIN, launcher name, and Chrome stderr. Then verify that the browser can reach the Karma server inside the container. Only after those checks should you adjust the version-appropriate capture or socket timeout.

Tests pass, Chrome exits, but Node stays alive

Confirm the stop event, then inspect active handles and the process tree. Disable coverage, custom reporters, file watchers, proxies, and build orchestration individually. Ensure every report stream and child process is awaited and closed.

ng test never returns

Verify that the Angular command is passing a one-shot setting through to Karma. Inspect generated or merged configuration rather than assuming a value in a standalone karma.conf.js is being used. Remove watch mode and any separate development server from the CI invocation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Samsung 27" Essential S3 (S36GD) Series FHD 1800R Curved Computer Monitor
  • CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
  • SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
  • MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
  • KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
  • INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient

The job hangs only after an upgrade

Record the old and new Node, Karma, launcher, browser, framework, and Puppeteer versions. Compare effective configuration and launch flags. An upgrade narrows the timeline but does not identify which process is responsible.

A disciplined repair sequence

  1. Save a full debug log from the exact CI command and a matching local command.
  2. Mark capture, test completion, browser exit, Karma stop, and shell return.
  3. Set and verify singleRun: true (or the wrapper’s equivalent).
  4. If capture fails, fix the executable, launcher, transport, or container prerequisites.
  5. If capture and tests succeed, inspect Node handles, reporters, coverage, proxies, and child processes.
  6. Compare CI and local versions, environment variables, limits, and wrapper scripts.
  7. Change one supported setting for the observed stage, then keep the resulting log.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

For automated page images or PDFs, ScreenshotNeo is a separate website screenshot API and MCP server; it does not replace Karma’s test runner, but it can remove the need to maintain a browser-capture stack for screenshot jobs. One GET request returns PNG, JPEG, WebP, or PDF. Before capture it accepts cookie/consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each cleanup step can be disabled. Bot checks/CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and whether it was billed. Its MCP tools—take_screenshot, get_page_info, and capture_pdf—work with Claude, Cursor, and other MCP clients.

See the ScreenshotNeo API documentation for parameters. cURL:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

Python:

import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)

Node.js:

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

Every plan includes its features: full-page and element capture, device presets and custom viewports, retina scale, dark mode, PDF controls, custom CSS/JavaScript, clicks, waits, request blocking, headers/cookies/user agents, timezone and geolocation, transparent backgrounds, resizing, TTL caching, signed links, asynchronous webhooks, bulk capture of 100 URLs per call, a usage API, and an OpenAPI specification. The free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots. Sign up for ScreenshotNeo free.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

FAQ

Does increasing Karma’s capture timeout fix every hang?

No. It addresses a browser that is slow to start or connect, not a process that remains after tests and browser shutdown.

Best Value
Sale
Sceptre New 22-Inch Gaming Monitor, FHD 1080p, Up to 144Hz, HDMI, DisplayPort, Built-in Speakers, Machine Black (E225W-FW144 Series, 2026)
  • 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
  • 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
  • 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.

Does processKillTimeout terminate the whole CI job?

No. It controls escalation for an unresponsive browser process. Node handles and outer CI processes require separate diagnosis.

Is watch mode always a bug?

No. Watch mode is intentionally persistent. It is a bug only when a one-shot CI job was intended and the effective configuration still enables watching.

Frequently Asked Questions

What does “ChromeHeadless have not captured” mean?

Karma did not receive a connection from the launched browser. Check the executable, launcher, container prerequisites, and transport before changing timeouts.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Why does this happen only in CI?

CI may use different Node, browser, package versions, flags, permissions, process limits, merged configuration, or wrapper processes. Compare those environments and inspect which process remains.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.