Skip to content

Fix flaky team planner and calendar sort specs#24000

Merged
myabc merged 1 commit into
devfrom
fix/flaky-team_planner_overview_sorting
Jul 1, 2026
Merged

Fix flaky team planner and calendar sort specs#24000
myabc merged 1 commit into
devfrom
fix/flaky-team_planner_overview_sorting

Conversation

@myabc

@myabc myabc commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Ticket

n/a

What are you trying to accomplish?

Stabilizes the flaky CI failure in team_planner_overview_spec.rb[1:4:4:1] ("allows sorting by all columns"), and applies the same fix to the identical (and equally racy) helper in the calendar module.

What approach did you choose and why?

The sortable column headers navigate via a full browser visit, not a Turbo Stream: sort_header_tagsort_linklink_to_content_update renders the link with target: "_top", and Turbo Drive does not intercept links carrying a target. So clicking a header triggers a full page reload that replaces the table asynchronously.

Pages::TeamPlanner#expect_views_listed_in_order snapshotted the rows once (all("tr td.name").map(&:text)) and compared them with a non-retrying eq. When the assertion ran before the post-sort document settled, it read the previous order and failed. Locally the lighter page settles before the snapshot, hiding the race; CI's compiled frontend and parallel load expose it.

The fix replaces the snapshot with retrying Capybara matchers that re-query the scoped table body until the expected order appears, so the assertion tolerates the reload instead of racing it. exact_text: preserves the exact-match semantics of the original eq. The change is scoped to the two spec page objects; no production code changes.

Merge checklist

  • Added/updated tests

@myabc myabc added the flaky-spec Addresses a Flaky Spec label Jun 29, 2026
@myabc myabc self-assigned this Jun 29, 2026
@myabc myabc requested a review from Copilot June 29, 2026 18:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR stabilizes the flaky Selenium feature spec around sorting in the Team Planner overview by making the page-object assertion resilient to full-page reloads triggered by sort header clicks.

Changes:

  • Reworks Pages::TeamPlanner#expect_views_listed_in_order to use retrying Capybara matchers instead of a one-shot DOM snapshot.
  • Adds inline documentation explaining why sorting causes asynchronous row replacement and why retrying matchers are required.

@myabc myabc force-pushed the fix/flaky-team_planner_overview_sorting branch from a42da97 to 5f07a25 Compare June 30, 2026 16:20
The shared `expect_views_listed_in_order` helpers snapshotted the table
rows with a non-retrying `eq`. The sortable column headers navigate via
a full browser visit (their links carry `target: "_top"`, so Turbo Drive
does not intercept), replacing the table asynchronously. When the
assertion ran before the post-sort document settled it read the previous
order, failing intermittently in CI while passing locally.

Replaces the snapshot with retrying Capybara matchers that re-query the
scoped table body until the expected order appears, and mirrors the fix
in the identical calendar helper to keep the two copies consistent.

Co-authored-by: myabc <755+myabc@users.noreply.github.com>
@myabc myabc force-pushed the fix/flaky-team_planner_overview_sorting branch from 5f07a25 to da73e12 Compare June 30, 2026 16:41
@myabc myabc marked this pull request as ready for review June 30, 2026 16:42
@myabc myabc changed the title Fix flaky team_planner_overview_spec sorting example Fix flaky team_planner_overview_spec sorting example Jun 30, 2026
@github-actions

Copy link
Copy Markdown

Warning

This pull request does not link an OpenProject work package.

Please add a link to the work package in the description, or reference it in the
title in square brackets, e.g. [SLUG-123] My title here.

@myabc myabc changed the title Fix flaky team_planner_overview_spec sorting example Fix flaky team planner and calendar sort specs Jun 30, 2026
@myabc myabc removed their assignment Jun 30, 2026
@myabc myabc requested a review from Copilot June 30, 2026 18:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@myabc myabc merged commit 18a98d2 into dev Jul 1, 2026
20 checks passed
@myabc myabc deleted the fix/flaky-team_planner_overview_sorting branch July 1, 2026 07:51
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 1, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Development

Successfully merging this pull request may close these issues.

3 participants