From 8cc3c4666141a4bf7f89c6014c792c52df300fa3 Mon Sep 17 00:00:00 2001 From: Muhammad Faisal Affan Date: Sat, 27 Jun 2026 13:41:03 +0700 Subject: [PATCH 1/2] fix: improve error handling for ariaSnapshot and fixture integrity --- packages/playwright/src/worker/fixtureRunner.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/packages/playwright/src/worker/fixtureRunner.ts b/packages/playwright/src/worker/fixtureRunner.ts index 9722b929135cf..ad4ee54b26027 100644 --- a/packages/playwright/src/worker/fixtureRunner.ts +++ b/packages/playwright/src/worker/fixtureRunner.ts @@ -158,11 +158,8 @@ class Fixture { private async _teardownInternal() { if (typeof this.registration.fn !== 'function') return; - if (this._usages.size !== 0) { - // TODO: replace with assert. - console.error('Internal error: fixture integrity at', this._teardownDescription.title); // eslint-disable-line no-console - this._usages.clear(); - } + if (this._usages.size !== 0) + throw new Error(`Internal error: fixture integrity at ${this._teardownDescription.title}`); if (this._useFuncFinished) { this._useFuncFinished.resolve(); this._useFuncFinished = undefined; From 4bf5eeb20f36c1767401ec7fbb764de439c961cf Mon Sep 17 00:00:00 2001 From: Muhammad Faisal Affan Date: Sun, 12 Jul 2026 12:16:53 +0700 Subject: [PATCH 2/2] chore: revert fixtureRunner change, keep only ariaSnapshot fix --- packages/playwright/src/worker/fixtureRunner.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/playwright/src/worker/fixtureRunner.ts b/packages/playwright/src/worker/fixtureRunner.ts index ad4ee54b26027..9722b929135cf 100644 --- a/packages/playwright/src/worker/fixtureRunner.ts +++ b/packages/playwright/src/worker/fixtureRunner.ts @@ -158,8 +158,11 @@ class Fixture { private async _teardownInternal() { if (typeof this.registration.fn !== 'function') return; - if (this._usages.size !== 0) - throw new Error(`Internal error: fixture integrity at ${this._teardownDescription.title}`); + if (this._usages.size !== 0) { + // TODO: replace with assert. + console.error('Internal error: fixture integrity at', this._teardownDescription.title); // eslint-disable-line no-console + this._usages.clear(); + } if (this._useFuncFinished) { this._useFuncFinished.resolve(); this._useFuncFinished = undefined;