Repository navigation
Conversation
Playwright's WebKit build sometimes blocks the page for seconds when a modal dialog leaves the top layer, on busy runners. With the global 3000 ms timeout, a blocked root cleanup hook aborted all remaining dialog tests (54 timeouts), and a blocked test's retry could get the leftover Escape press of the blocked attempt. The dialog suite now has a 15 s timeout and cleans up its fixtures in its own hook, so the cleanup runs within that timeout. Closes #606 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Tests get 10 s (two attempts stay well within the file's 120 s), the suite's fixture cleanup 25 s, which covers the longest WebKit stall seen locally (about 20 s). The comment no longer suggests that the leftover key presses of a blocked attempt are impossible. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reviewer's GuideTestsGive the dialog test suite and fixture cleanup longer, separate timeouts so WebKit stalls are less likely to abort the suite or interfere with retries.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #607 +/- ##
==========================================
+ Coverage 77.46% 77.53% +0.07%
==========================================
Files 76 76
Lines 19477 19477
Branches 1268 1269 +1
==========================================
+ Hits 15087 15102 +15
+ Misses 4368 4355 -13
+ Partials 22 20 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Linked issuesChecked at commit 7285baf #606 test: fix flaky WebKit tests of the design dialog · 2 of 2 met
|
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="packages/ecc-utils-design/src/components/dialog/tests/dialog.test.ts" line_range="140" />
<code_context>
+ // blocked attempt; a blocked hook isn't retried and aborts all remaining
+ // tests. The longer timeouts make both rare, not impossible. (`this.timeout`
+ // needs a `function`, not an arrow function.)
+ this.timeout(10000);
+
+ // Removes the fixtures with a longer timeout than the tests (the cleanup of
</code_context>
<issue_to_address>
**Nested dialog closes unexpectedly**
When a test-body Escape-triggered close stalls for more than 10 seconds, `this.timeout(10000)` expires while `sendKeys` or `updateComplete` is still pending, so Mocha retries before the first Escape finishes; the late and retried presses can close the outer dialog too, and the nested-dialog test fails intermittently.
Raise the test timeout above the documented 20-second stall window while keeping the cleanup timeout longer.
</issue_to_address>Sourcery assessment
Approval pending. 1 finding to address first.
Blocking findings: packages/ecc-utils-design/src/components/dialog/tests/dialog.test.ts:140
Documentation build overview
54 files changed ·
|
Summary
Fixes the flaky WebKit dialog tests of
@elixir-cloud/design(Node 22 and 24) by changing only the dialog tests. No assertion changed.Cause. Playwright's WebKit build sometimes blocks the page's main thread for seconds (5–20 s seen locally) when a modal dialog leaves the top layer, either through
dialog.close()or when an open dialog is removed. Instrumented runs showed that the time is spent inside WebKit, before any of the component's callbacks run. The global mocha timeout is 3000 ms withretries: 1(web-test.runner-config.mjs), which leads to two failure modes:afterEachof@open-wc/testing, which runsfixtureCleanup()and so removes the open dialogs. Mocha fails a synchronous hook that runs longer than its timeout. Hooks aren't retried, and a failed root hook aborts every remaining test of the file.Fix. In
dialog.test.ts, the dialog suite now has a 10 s timeout. Its ownafterEachrunsfixtureCleanup()with a 25 s timeout and runs before the root hook, which then has nothing left to remove. The comment says that this makes both failure modes rare, not impossible.Verification
WebKit 26.0 (Playwright 1.56.1 build 2215, with the Ubuntu 24.04 libraries extracted locally), with the full design suite in all three browsers, pinned to 2 CPUs (
taskset -c 0,1) to imitate a busy runner. Command:npx web-test-runner --group default --port 8000 --config ../../web-test.runner-config.mjs.eslint --max-warnings 0andprettier --checkon the file pass, and so does the pre-commitnpm run lint.Local-only noise (not CI): the Ace code-editor tests in
global.test.tsload their worker fromcdn.jsdelivr.net, which the local sandbox blocks, so they failed now and then. That is unrelated to this change.Decisions taken
concurrency: 1for WebKit was tried and didn't help (1 mass failure in 30 runs).Declined review findings
testsFinishTimeout(120 s per file), because several long stalls in one file could add up past it. Declined: one stall that fails both attempts already takes up to 70 s. Two of them in one run would be needed to pass the limit, which wasn't seen in 90 runs, and raising the limit would change all packages. Revisit if "Browser tests did not finish" shows up.Open questions
None.
Closes #606
🤖 Generated with Claude Code
Summary by Sourcery
Stabilize WebKit dialog tests under intermittent browser main-thread stalls without changing their assertions.
Bug Fixes:
Enhancements: