test: fix group-by suite flakes#16816
Merged
Merged
Conversation
The group-by E2E suite failed deterministically on CI (every recent main run) at openListFilters: `#list-controls-where.rah-static--height-auto` never became visible. CI traces show the Filters toggle ended with aria-expanded="false" — the open click was dropped. openListFilters decided whether to open the drawer from a point-in-time `filterContainer.isVisible()` reading, then clicked once and asserted. The container flickers visible mid-animation, and a preceding re-render (the group-by change applied just before in the failing test) can swallow the toggle's React state update on slower CI hardware, so the single click is lost and the drawer never opens. Drive the open state off the toggler's authoritative `aria-expanded` attribute and retry the toggle via expect().toPass() until it reports open, making the helper idempotent and resilient to the race. Does not reproduce locally (passes in every local config incl. 8x CPU throttle); root cause and fix are derived from the CI Playwright trace.
Contributor
📦 esbuild Bundle Analysis for payloadThis analysis was generated by esbuild-bundle-analyzer. 🤖
Largest pathsThese visualization shows top 20 largest paths in the bundle.Meta file: packages/next/meta_index.json, Out file: esbuild/index.js
Meta file: packages/payload/meta_index.json, Out file: esbuild/index.js
Meta file: packages/payload/meta_shared.json, Out file: esbuild/exports/shared.js
Meta file: packages/richtext-lexical/meta_client.json, Out file: esbuild/exports/client_optimized/index.js
Meta file: packages/ui/meta_client.json, Out file: esbuild/exports/client_optimized/index.js
Meta file: packages/ui/meta_shared.json, Out file: esbuild/exports/shared_optimized/index.js
DetailsNext to the size is how much the size has increased or decreased compared with the base branch of this PR.
|
AlessioGr
approved these changes
Jun 1, 2026
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.
Overview
Fixes a deterministic CI-only failure in the
group-byE2E suite by hardening the sharedopenListFilterstest helper.E2E - group-byhas failed on every recentmainrun atshould apply filters to the distinct results of the group-by field, across all 6 attempts (original plus 5 retries):Key Changes
openListFiltersopens the drawer offaria-expandedand retries the togglefilterContainer.isVisible()reading, then clicked the toggler once and asserted the expanded container. It now reads the toggler'saria-expandedattribute as the open/closed signal and retries the click viaexpect().toPass()until the toggle reports open. The happy path is unchanged.Design Decisions
The CI Playwright trace showed the
#toggle-list-filtersbutton ending witharia-expanded="false"— the drawer never opened, so the open click was dropped.Two factors combined under CI timing. The
#list-controls-whereAnimateHeightcontainer is briefly visible mid-animation, soisVisible()is not a reliable open/closed signal. And the toggle is a plain ReactuseState: in the failing test,addGroupByruns immediately before the first filter, mutating the URL and re-renderingListControls. On slower CI hardware the toggle click lands during that re-render and its state update is lost, so the single un-verified click never opens the drawer.Reading
aria-expanded(the toggle's source of truth) and retrying until it reports open makes the helper idempotent and resilient to a dropped click. AllopenListFilterscallers use the default#toggle-list-filterstoggler, which exposesaria-expanded; the customtogglerSelectoroverrides elsewhere are for the columns helpers and are unaffected.The failure does not reproduce locally. It passes in every local configuration tried (dev and prod builds, isolated and full-suite, the exact CI command, and under 8x CPU plus network throttling). Root cause and fix come from the CI trace, so CI on this branch is the real validation.