From e50e799487a94394de7227e154765e1ae048ef1d Mon Sep 17 00:00:00 2001 From: Joel Arvidsson <joel@oblador.se> Date: Tue, 31 Oct 2023 14:39:34 +0100 Subject: [PATCH] Lock Chrome version in docker tests (#484) --- .../src/create-chrome-docker-target.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/target-chrome-docker/src/create-chrome-docker-target.js b/packages/target-chrome-docker/src/create-chrome-docker-target.js index a839b628..35be5f0c 100644 --- a/packages/target-chrome-docker/src/create-chrome-docker-target.js +++ b/packages/target-chrome-docker/src/create-chrome-docker-target.js @@ -43,7 +43,7 @@ const waitOnCDPAvailable = (host, port) => function createChromeDockerTarget({ baseUrl = 'http://localhost:6006', - chromeDockerImage = 'yukinying/chrome-headless-browser-stable', + chromeDockerImage = 'yukinying/chrome-headless-browser-stable:100.0.4896.127', chromeFlags = ['--headless', '--disable-gpu', '--hide-scrollbars'], dockerNet = null, dockerWithSudo = false, @@ -180,7 +180,13 @@ function createChromeDockerTarget({ async function stop() { if (dockerId) { debug(`Killing chrome docker instance with id ${dockerId}`); - await execute(dockerPath, ['kill', dockerId]); + try { + await execute(dockerPath, ['kill', dockerId]); + } catch (e) { + if (e.toString().indexOf('No such container') === -1) { + throw e; + } + } } else { debug('No chrome docker instance to kill'); }