test(reporter): give each spawned flake-lab run its own output dir - #690
Merged
Merged
Conversation
The flake specs spawn Playwright from temp projects inside packages/reporter/tests/. Without an outputDir, Playwright resolves it from the nearest package.json, so every run wrote to the shared packages/reporter/test-results/ and cleared it on start. When flake-cli-run.spec.ts started a run while flake-run.spec.ts was closing a browser context, the trace write failed with ENOENT. That error changed the target's error signature (matchesHistory false) or failed the companion. Set outputDir to the temp project's own test-results/ in both configs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y2hBXFyRE51AcZPXH3o1Lm
Contributor
Coverage Report for Reporter (./packages/reporter)
File CoverageNo changed files found. |
Contributor
Coverage Report for Application (./apps/application)
File CoverageNo changed files found. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
CI's "Lint, typecheck and unit tests" job has been failing on
mainsince the flake-lab work landed (run 36513556098, and on #689). The failures are inpackages/reporter/tests/flake-run.spec.ts:matchesHistory: falseinstead oftrue;browserContext.close: ENOENT … packages/reporter/test-results/.playwright-artifacts-N/traces/….network.Root cause:
flake-run.spec.tsandflake-cli-run.spec.tseach spawn a real Playwright run from a temp project insidepackages/reporter/tests/. Neither config setsoutputDir, so Playwright resolves it from the nearestpackage.json. Both runs therefore write to the sharedpackages/reporter/test-results/, and each run clears that folder when it starts. vitest runs the two files concurrently. When one run starts while the other is closing a browser context, the second run's trace write fails with ENOENT. That error either replaces the target's expected error signature (somatchesHistoryis false) or fails the companion.Fix: set
outputDir: './test-results'in both spawned configs, so each run writes inside its own temp project. That folder is removed with the project inafterAll. No assertion is changed and nothing is skipped or retried.How was it tested?
main:npm run reporter:test:coverage(the CI command) failed 1 of 2 runs with the samematchesHistoryassertion as CI.reporter:typecheck,reporter:lint,reporter:format:checkand commitlint are clean.Checklist
type(scope): subject)🤖 Generated with Claude Code
https://claude.ai/code/session_01Tx72FSSvzNpoz6RUcBEkrx
Generated by Claude Code