Skip to content

Commit 9136655

Browse files
enesozturkclaude
andcommitted
fix(laboratory): register the canary upload hook once per suite
Playwright scopes afterEach to the suite, not to the test object it was registered on, so registering per canary fixture ran both hooks for every test and uploaded each datapoint twice. Registering on the shared timingFixture covers every test object in the file and fires once. Applies the hook placement from #5753. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 2781a96 commit 9136655

1 file changed

Lines changed: 5 additions & 10 deletions

File tree

apps/laboratory/tests/verify.spec.ts

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,12 @@ import { afterEachCanary, getCanaryTagAndAnnotation } from './shared/utils/metri
1515
import { ModalValidator } from './shared/validators/ModalValidator'
1616

1717
/*
18-
* Upload canary metrics for the @canary-tagged verify tests below. This hook is a
19-
* no-op for tests without the @canary tag and outside canary environments.
18+
* Uploads canary metrics for the @canary-tagged tests below; a no-op for untagged tests and
19+
* outside canary environments. Registered on the shared timingFixture rather than on each canary
20+
* fixture: Playwright scopes hooks to the suite, so per-fixture registration would run every hook
21+
* for every test in the file and upload each datapoint twice.
2022
*/
21-
testMWagmiVerifyValid.afterEach(async ({ browserName, timingRecords }, testInfo) => {
22-
if (browserName === 'firefox') {
23-
return
24-
}
25-
await afterEachCanary(testInfo, timingRecords)
26-
})
27-
28-
testMWagmiVerifyEvil.afterEach(async ({ browserName, timingRecords }, testInfo) => {
23+
timingFixture.afterEach(async ({ browserName, timingRecords }, testInfo) => {
2924
if (browserName === 'firefox') {
3025
return
3126
}

0 commit comments

Comments
 (0)