From 1d551cff20ac3eb82b3f359f62713b0286e63151 Mon Sep 17 00:00:00 2001 From: Peter Hedenskog Date: Sun, 18 Oct 2026 23:05:45 +0200 Subject: [PATCH] Always stop the browser when an iteration fails The cleanup after a failed iteration read the connectivity settings without checking that they exist. When Browsertime runs without connectivity settings, as can happen when it is used as a library, that read threw an error. The error was swallowed, so the browser was never stopped and kept running. Assisted-by: Claude Opus 5.5 noreply@anthropic.com --- lib/core/engine/iteration.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/core/engine/iteration.js b/lib/core/engine/iteration.js index 665de97ba..2e38cdf3b 100644 --- a/lib/core/engine/iteration.js +++ b/lib/core/engine/iteration.js @@ -195,7 +195,7 @@ export class Iteration { // Here we should also make sure FFMPEG is really killed/stopped // if something fails, we had bug reports where we miss it try { - if (options.connectivity.variance) { + if (options.connectivity?.variance) { await removeConnectivity(options); } if (options.browser === 'firefox' && options.debug) {