From d28e8c1c65b19331b90b17fc02d9f419be83a35b Mon Sep 17 00:00:00 2001 From: Dmitry Vorotilin Date: Sun, 18 Oct 2026 23:28:22 +0300 Subject: [PATCH] test(tracing): close the second page before stopping the trace to avoid a slow tracingComplete Chrome delays Tracing.tracingComplete by several seconds while waiting for the renderer of a page opened mid-trace to flush, so under load the outer record exceeded the 5s timeout and returned nil. --- spec/page/tracing_spec.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spec/page/tracing_spec.rb b/spec/page/tracing_spec.rb index ceba1120..891c81ae 100644 --- a/spec/page/tracing_spec.rb +++ b/spec/page/tracing_spec.rb @@ -44,11 +44,12 @@ page.tracing.record(path: file_path) do page.go_to + another = browser.create_page expect do - another = browser.create_page another.tracing.record(path: file_path2) { another.go_to } end.to raise_exception(Ferrum::BrowserError, "Tracing has already been started (possibly in another tab).") expect(File.exist?(file_path2)).to be(false) + another.close end expect(File.exist?(file_path)).to be(true)