From 494835871bf837598a6eaecd1306dbe82bb4b6a8 Mon Sep 17 00:00:00 2001 From: Francesco Gringl-Novy Date: Wed, 20 May 2026 10:23:54 +0200 Subject: [PATCH] test(browser): Allow profile frames without abs_path for clearTimeout Adds `clearTimeout` to the list of built-in browser functions that may appear in JSSelfProfiler-sampled frames without `abs_path`/`lineno`/ `colno`, alongside `fetch` and `setTimeout`. The chunk-timer cleanup inside the profiler's stop path can sample a `clearTimeout` frame that trips `validateProfile`'s assertion. Fixes #20957 Co-Authored-By: Claude Opus 4.7 (1M context) --- .../browser-integration-tests/suites/profiling/test-utils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dev-packages/browser-integration-tests/suites/profiling/test-utils.ts b/dev-packages/browser-integration-tests/suites/profiling/test-utils.ts index a5acab8b9de3..e82eac73eb79 100644 --- a/dev-packages/browser-integration-tests/suites/profiling/test-utils.ts +++ b/dev-packages/browser-integration-tests/suites/profiling/test-utils.ts @@ -99,8 +99,8 @@ export function validateProfile( expect(frame).toHaveProperty('function'); expect(typeof frame.function).toBe('string'); - // Some browser functions (fetch, setTimeout) may not have file locations - if (frame.function !== 'fetch' && frame.function !== 'setTimeout') { + // Some browser functions (fetch, setTimeout, clearTimeout) may not have file locations + if (frame.function !== 'fetch' && frame.function !== 'setTimeout' && frame.function !== 'clearTimeout') { expect(frame).toHaveProperty('abs_path'); expect(frame).toHaveProperty('lineno'); expect(frame).toHaveProperty('colno');