Repository navigation
fix: de-flake e2e DevTools poll and remove new-code duplication - #238
Merged
Merged
Conversation
The keep-open test's `isDevToolsOpened()` poll used Playwright's default 5s timeout, which is too tight when a detached DevTools window has to open on a busy runner (observed flaking on Ubuntu 24.04 under Xvfb once the matrix gained its ninth platform). Give both DevTools polls a 15s budget. While here, extract the focus/blur and visibility-poll sequences that the Windows and keep-open tests repeated into helpers, removing the copy-paste duplication Sonar flagged on new code.
SonarCloud's quality gate failed on new-code duplication (9.3% vs 3%). The largest contributor was the near-identical tail of the e2e and visual platform-table scripts. Move the shared read/parse/sort/rewrite logic into tests/shared/update-platforms.mts, leaving each entry point to declare only its markers, results dir, and block builder. Output is byte-for-byte unchanged (verified against the previous scripts). Also hoist the `ready`/`findHandler` helpers that were copy-pasted across several Menubar.spec.ts describe blocks to module scope.
|
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.



Summary
Fixes the two
mainfailures from the latest push.1. GitHub Actions — E2E flake
Run 37625359729 (
cad45c6) failed only onE2E [Ubuntu 24.04]: the "keep-open changes survive DevTools and restore click-away dismissal" test timed out waiting forisDevToolsOpened()(default 5s poll, failed original + retry). The same test passed on Ubuntu 24.04 in the two prior runs, so it is a flake — a detached DevTools window opening under Xvfb can exceed 5s on a busier runner (the matrix just gained a ninth platform).Fix: give both DevTools polls a 15s budget.
2. SonarCloud — quality gate ERROR
Only failing condition was new-code duplication 9.3% (limit 3%). No open issues or hotspots.
Fix (dedupe the flagged blocks):
tests/shared/update-platforms.mts; each entry point now declares only its markers, results dir, and block builder.ready/findHandlerhelpers inMenubar.spec.tsto module scope.Verification
pnpm run lint:check✅pnpm run typecheck✅pnpm run test✅ (129 passed)pnpm run test:e2e✅ (7 passed, 1 skipped, on macOS)update-platformsscripts produce byte-for-byte identicalPLATFORMS.md(checked changed / unchanged / empty-results paths).