Summary
test-analytics-fluid-charts.js (the "Kpa-clawbot#1058 Analytics fluid charts E2E" step in the Playwright job, .github/workflows/deploy.yml around line 581) fails intermittently on PRs that don't touch analytics. A single rerun has gone green each time.
Observed failures
| PR |
Run / job (attempt 1) |
Failing step |
| #135 (live.js only) |
run 36543893158, job 109332087103 |
viewport 2560 / wrapper 2520px → side-by-side (≥2 cols), no overflow: expected ≥2 columns at wrapper 2520px; got 1 |
| #139 (map.js/CSS for the map side pane only) |
run 36557644736, job 109377157851 |
AC3: layout reflows on resize (1440 side-by-side → 768 stacked): precondition failed: expected ≥2 cols at 1300px; got 1 |
Different steps fail, always the same way: a width that should give ≥2 columns measures 1 column. All other steps in the same run pass. Note: the batch agent reported these as test-charts-fluid-1058-e2e.js, which is a different test (it passed 23/23 in both runs); its 20/20 local reruns therefore did not exercise the flaky file.
Likely cause (hypothesis, not yet reproduced)
The harness writes a temp HTML file that pulls in style.css with <link rel="stylesheet"> and navigates with page.goto(..., { waitUntil: 'domcontentloaded' }) (around line 82). colCount() then measures card positions immediately. domcontentloaded does not wait for stylesheets, so on a slow CI runner the measurement can run before the grid/container-query CSS applies; unstyled cards stack in one column, which is exactly the observed "got 1".
Proposed fix
- Wait for styles before measuring:
waitUntil: 'load', or wait until getComputedStyle(grid).containerType is inline-size (the opt-in the first step already asserts) and the grid has its column template, before calling colCount().
- Apply the same wait after
setViewportSize in the resize step (AC3).
- No change to the CSS under test.
Acceptance criteria
- Reproduce first: e.g. delay the stylesheet (route interception or a throttled
file:// → local server) so the unfixed test fails deterministically, and show it passes with the fix.
- The test runs ≥50 times in a row without failure locally, and CI stays green.
- The assertions themselves (column counts, overflow, reflow) are unchanged.
Summary
test-analytics-fluid-charts.js(the "Kpa-clawbot#1058 Analytics fluid charts E2E" step in the Playwright job,.github/workflows/deploy.ymlaround line 581) fails intermittently on PRs that don't touch analytics. A single rerun has gone green each time.Observed failures
viewport 2560 / wrapper 2520px → side-by-side (≥2 cols), no overflow: expected ≥2 columns at wrapper 2520px; got 1AC3: layout reflows on resize (1440 side-by-side → 768 stacked): precondition failed: expected ≥2 cols at 1300px; got 1Different steps fail, always the same way: a width that should give ≥2 columns measures 1 column. All other steps in the same run pass. Note: the batch agent reported these as
test-charts-fluid-1058-e2e.js, which is a different test (it passed 23/23 in both runs); its 20/20 local reruns therefore did not exercise the flaky file.Likely cause (hypothesis, not yet reproduced)
The harness writes a temp HTML file that pulls in
style.csswith<link rel="stylesheet">and navigates withpage.goto(..., { waitUntil: 'domcontentloaded' })(around line 82).colCount()then measures card positions immediately.domcontentloadeddoes not wait for stylesheets, so on a slow CI runner the measurement can run before the grid/container-query CSS applies; unstyled cards stack in one column, which is exactly the observed "got 1".Proposed fix
waitUntil: 'load', or wait untilgetComputedStyle(grid).containerTypeisinline-size(the opt-in the first step already asserts) and the grid has its column template, before callingcolCount().setViewportSizein the resize step (AC3).Acceptance criteria
file://→ local server) so the unfixed test fails deterministically, and show it passes with the fix.