Skip to content

Commit

Permalink
Catch xvfb (#2252)
Browse files Browse the repository at this point in the history
  • Loading branch information
soulgalore authored Jan 13, 2025
1 parent b9ab109 commit f05dd8f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/support/xvfb.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit f05dd8f

Please sign in to comment.