diff --git a/apps/web/test/perf/appHarness.ts b/apps/web/test/perf/appHarness.ts index 3f96d7ffdd..1faba0a07e 100644 --- a/apps/web/test/perf/appHarness.ts +++ b/apps/web/test/perf/appHarness.ts @@ -102,6 +102,7 @@ export interface PerfAppHarness { readonly browserMetrics: BrowserPerfMetrics; readonly serverMetrics: ReadonlyArray | null; }>; + readonly dispose: () => Promise; } async function pickFreePort(): Promise { @@ -467,6 +468,10 @@ export async function startPerfAppHarness( return await finishPromise; }, + dispose: async () => { + await sampler.stop().catch(() => undefined); + await teardown(); + }, }; } catch (error) { await Promise.allSettled([ diff --git a/apps/web/test/perf/virtualization.perf.test.ts b/apps/web/test/perf/virtualization.perf.test.ts index 34b3e8fd88..07f4dc41bf 100644 --- a/apps/web/test/perf/virtualization.perf.test.ts +++ b/apps/web/test/perf/virtualization.perf.test.ts @@ -163,19 +163,7 @@ test("virtualization stays bounded and heavy thread switches remain snappy", asy finished = true; } finally { if (harness && !finished) { - await harness.finishRun({ - suite: "virtualization", - scenarioId: "large_threads", - thresholds, - metadata: { - heavyThreadMessageCount: harness.seededState.threadSummaries.find( - (thread) => thread.id === PERF_CATALOG_IDS.largeThreads.heavyAThreadId, - )?.messageCount, - }, - actionSummary: { - threadSwitchActionPrefix: "thread-switch", - }, - }); + await harness.dispose(); } } }); diff --git a/apps/web/test/perf/websocket-application.perf.test.ts b/apps/web/test/perf/websocket-application.perf.test.ts index 29b53fa0df..0387501887 100644 --- a/apps/web/test/perf/websocket-application.perf.test.ts +++ b/apps/web/test/perf/websocket-application.perf.test.ts @@ -117,24 +117,7 @@ test("high-frequency websocket events stay responsive under real built-app flow" finished = true; } finally { if (harness && !finished) { - await harness.finishRun({ - suite: "websocket-application", - scenarioId: "dense_assistant_stream", - thresholds, - metadata: { - burstSeedThreadId: PERF_CATALOG_IDS.burstBase.burstThreadId, - navigationThreadId: PERF_CATALOG_IDS.burstBase.navigationThreadId, - fillerThreadId: PERF_CATALOG_IDS.burstBase.fillerThreadId, - navigationLiveAssistantMessageId: - PERF_CATALOG_IDS.provider.navigationLiveAssistantMessageId, - burstLiveAssistantMessageId: PERF_CATALOG_IDS.provider.burstLiveAssistantMessageId, - sentinelText: PERF_PROVIDER_SCENARIOS.dense_assistant_stream.sentinelText, - }, - actionSummary: { - threadSwitchActionPrefix: "thread-switch", - burstActionName: "burst-completion", - }, - }); + await harness.dispose(); } } });