From 7b1994bc6745ae6703b322c30b1f6f334dd494cc Mon Sep 17 00:00:00 2001 From: kirillzyusko Date: Mon, 24 Jun 2024 10:57:31 +0300 Subject: [PATCH] chore: changes after review --- tests/e2e/utils/measure.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/e2e/utils/measure.ts b/tests/e2e/utils/measure.ts index 0a5aface56f2..96ac1bb4541e 100644 --- a/tests/e2e/utils/measure.ts +++ b/tests/e2e/utils/measure.ts @@ -4,11 +4,12 @@ import {ThreadNames} from '@perf-profiler/types'; import type {Measure} from '@perf-profiler/types'; let measures: Measure[] = []; -let polling = { +const POLLING_STOPPED = { stop: (): void => { throw new Error('Cannot stop polling on a stopped profiler'); }, }; +let polling = POLLING_STOPPED; const start = (bundleId: string) => { // clear our measurements results @@ -23,6 +24,7 @@ const start = (bundleId: string) => { const stop = () => { polling.stop(); + polling = POLLING_STOPPED; const average = getAverageCpuUsagePerProcess(measures); const uiThread = average.find(({processName}) => processName === ThreadNames.ANDROID.UI)?.cpuUsage;