From f05dd8f2e195f5a51651d7380ba0b383045b9949 Mon Sep 17 00:00:00 2001 From: Peter Hedenskog Date: Mon, 13 Jan 2025 16:57:59 +0100 Subject: [PATCH] Catch xvfb (#2252) --- lib/support/xvfb.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/support/xvfb.js b/lib/support/xvfb.js index 1dcbb15e2..f82b14656 100644 --- a/lib/support/xvfb.js +++ b/lib/support/xvfb.js @@ -3,6 +3,9 @@ import { xvfbDisplay } from '../video/defaults.js'; import { getViewPort } from '../support/getViewPort.js'; import { getProperty } from '../support/util.js'; import { isAndroidConfigured } from '../android/index.js'; +import { getLogger } from '@sitespeed.io/log'; + +const logger = getLogger('browsertime'); function buildXvfbCommand({ display, screen = 0, size, silent }) { return { @@ -43,6 +46,10 @@ export async function startXvfb({ size, options }) { detached: true }); + xvfbProcess.catch(error => { + logger.error('Failed xvfb:', error); + }); + const waitToSettle = getProperty(options, 'xvfbParams.waitToSettle', 500); await new Promise(resolve => { setTimeout(resolve, waitToSettle);