diff --git a/desktop/tests/e2e/member-heavy-switch.perf.ts b/desktop/tests/e2e/member-heavy-switch.perf.ts index 69efb094ab..1fdff110af 100644 --- a/desktop/tests/e2e/member-heavy-switch.perf.ts +++ b/desktop/tests/e2e/member-heavy-switch.perf.ts @@ -94,6 +94,10 @@ async function measureSwitch( __LONGTASKS__: number[]; __LONGTASK_OBSERVER__?: PerformanceObserver; }; + // Discard pending deliveries from BEFORE this sample: a longtask + // trailing the previous switch is delivered in a later task and would + // otherwise land in this sample's fresh array. + store.__LONGTASK_OBSERVER__?.takeRecords(); store.__LONGTASKS__ = []; const link = document.querySelector( `[data-testid="${args.targetTestId}"]`,