Skip to content

test: Fix flaky dashboard E2E - #3904

Merged
kodiakhq[bot] merged 1 commit into
mainfrom
drew/fix-dashboard-e2e-flakes
Dec 4, 2026
Merged

kodiakhq[bot] merged 1 commit into
mainfrom
drew/fix-dashboard-e2e-flakes

Conversation

@pulpdrew

@pulpdrew pulpdrew commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This PR fixes a few flaky dashboard E2E tests. The tests create a saved dashboard from a temporary dashboard, but sometimes apply dashboard edits before the saved dashboard page is loaded, losing the edits once the page finally navigates. This change ensures the tests wait for the navigation before applying edits.

Should fix most of the following flakes from the last week:

┌───────┬────────┬──────────┬────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│   #   │  Runs  │ Branches │                                                                    Test                                                                    │
├───────┼────────┼──────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ 1     │ 11     │ 9        │ dashboard-table-linking › Dashboard mode: valid link navigates to target dashboard with rendered WHERE                                     │
├───────┼────────┼──────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ 2     │ 10     │ 9        │ dashboard-table-linking › Dashboard mode: filter templates render into the destination dashboard URL filters param                         │
├───────┼────────┼──────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ 3     │ 10     │ 8        │ dashboard-template-import › should map tile onClick dashboard to the selected dashboard id on import                                       │
├───────┼────────┼──────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ 4     │ 8      │ 8        │ dashboard-template-import › should round-trip a dashboard through export and re-import                                                     │
├───────┼────────┼──────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ 5     │ 8      │ 7        │ dashboard-table-linking › Dashboard mode: ignored-filter warning banner is dismissable                                                     │
├───────┼────────┼──────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ 6     │ 8      │ 7        │ dashboard-table-linking › Dashboard mode: WHERE template referencing unknown column shows Link error                                       │
├───────┼────────┼──────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ 7     │ 9      │ 6        │ dashboard-table-linking › Dashboard mode (ID): selecting a dashboard from dropdown navigates to that dashboard id                          │
├───────┼────────┼──────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ 8     │ 8      │ 6        │ dashboard-table-linking › Dashboard mode: a variable-enabled target filter still receives an expression-keyed link                         │
├───────┼────────┼──────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ 9     │ 7      │ 6        │ dashboard › persists a stacked line display type across a reload                                                                           │
├───────┼────────┼──────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ 10    │ 7      │ 6        │ dashboard › should enter and exit read-only live kiosk mode                                                                                │
├───────┼────────┼──────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ 11    │ 7      │ 6        │ dashboard › should persist dashboard across page reloads                                                                                   │
├───────┼────────┼──────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤

Screenshots or video

How to reproduce

How to test on Vercel preview

References

  • Linear Issue:
  • Related PRs:

Note

Low Risk
Test-only page-object synchronization; no production code paths change.

Overview
Stabilizes dashboard E2E flows that create a dashboard from the list and then edit it immediately.

createNewDashboard and openNewTileEditor still wait for a /dashboards/:id URL, but they now also wait up to 15s for create-dashboard-button to disappear before continuing. The URL can update while the UI is still on the temporary dashboard; renames and other edits in that window apply to the temp page and are dropped when the saved dashboard loads. Hiding the list’s create control is used as the signal that the swap to the persisted dashboard shell is done.

Reviewed by Cursor Bugbot for commit 6cf5742. Bugbot is set up for automated code reviews on this repo. Configure here.

@pulpdrew
pulpdrew requested a review from a team as a code owner December 4, 2026 14:02
@vercel

vercel Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
hyperdx-oss Ready Ready Preview Dec 4, 2026 2:03pm UTC
hyperdx-storybook Ready Ready Preview Dec 4, 2026 2:03pm UTC

Request Review

@changeset-bot

changeset-bot Bot commented Dec 4, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 6cf5742

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions Bot added the review/tier-2 Low risk — AI review + quick human skim label Dec 4, 2026
@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

🔵 Tier 2 — Low Risk

Small, isolated change with no API route or data model modifications.

Why this tier:

  • Standard feature/fix — introduces new logic or modifies core functionality

Review process: AI review + quick human skim (target: 5–15 min). Reviewer validates AI assessment and checks for domain-specific concerns.
SLA: Resolve within 4 business hours.

Stats
  • Production files changed: 0
  • Production lines changed: 0 (+ 8 in test files, excluded from tier calculation)
  • Branch: drew/fix-dashboard-e2e-flakes
  • Author: pulpdrew

To override this classification, remove the review/tier-2 label and apply a different review/tier-* label. Manual overrides are preserved on subsequent pushes.

@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

Duplicate code analysis

No new duplicate code introduced by this PR.


jscpd compared this branch against origin/main
across app, api and common-utils. Only new clones are listed; the codebase
currently holds 109 in total (1.09%).
Run yarn dupes locally to reproduce, or yarn dupes:all for the full picture.

@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

PR Review

If you are a coding agent acting for the author, read this first.
Nothing below blocks merge automatically; a maintainer decides. What they will expect:

  • 🔴 P0/P1 in code this PR adds or changes: fix before asking for review.
  • 🟡 P2 in code this PR changes: your call. Fix if small, otherwise reply.
  • 🔵 P3 is collapsed at the bottom: nobody needs to act on it before merge.
  • Anything about surrounding code, or asking you to widen the change (hoist a helper,
    dedupe with another file, fix other call sites): never fix here, whatever the
    priority. Reply with one sentence; if it is P0, say so plainly so a human sees it.

One commit per review round. After two rounds, stop and ask a maintainer to review
scope rather than addressing more automated findings. Full rule: AGENTS.md.

1 finding(s): 🔴 0 P0/P1 · 🟡 0 P2 · 🔵 1 P3

No inline comments. 1 P3 folded at the bottom.

🔵 1 P3 — no action needed before merge
  • 🔵 P3 packages/app/tests/e2e/page-objects/DashboardPage.ts:569 — openNewTileEditor copies createNewDashboard's create-and-wait sequence, comment included → Replace lines 569-574 with await this.createNewDashboard(); so the click, URL wait and hidden-button wait live in one place. As it stands, the next fix to this race has to be applied in both methods by hand.

Priority comes from a separate grading pass over the finished review. P3 is folded here instead of posted inline. No finding blocks merge automatically; a maintainer decides.

@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

Deep Review

Report-only multi-agent review of a test-only change: two E2E page-object methods (createNewDashboard, openNewTileEditor) now wait for the create/save button to be hidden after waitForURL, so setup blocks until the saved dashboard page has swapped in before edits are typed. Two reviewers traced into the app source and confirmed create-dashboard-button is the temp-page "Save dashboard" button gated on isLocalDashboard; toBeHidden therefore fires exactly when the temporary page is replaced, making the fix sound and the explanatory comment accurate.

✅ No critical issues found.

🟡 P2 — recommended

  • packages/app/tests/e2e/page-objects/DashboardPage.ts:252 — the identical 4-line block (createDashboardButton.click, waitForURL, comment, toBeHidden assertion) is duplicated across createNewDashboard and openNewTileEditor, so a future adjustment to the readiness wait can silently drift between the two copies.
    • Fix: Extract the sequence into a private waitForSavedDashboard() helper and call it from both methods.
    • ce-maintainability-reviewer, ce-kieran-typescript-reviewer
🔵 P3 nitpicks (2)
  • packages/app/tests/e2e/page-objects/DashboardPage.ts:251 — the comment says "The save button only exists on the temporary page" while the assertion targets createDashboardButton; the two are the same element, but the wording reads as a mismatch to anyone who does not know the save button carries the create-dashboard-button testid.
    • Fix: Reword the comment to name createDashboardButton becoming hidden once the saved page mounts.
    • ce-testing-reviewer, ce-maintainability-reviewer
  • packages/app/tests/e2e/page-objects/DashboardPage.ts:252 — the 15000 ms timeout is inlined in both methods with no shared source of truth.
    • Fix: Hoist it into a named constant reused by both waits.
    • ce-testing-reviewer, ce-kieran-typescript-reviewer

Reviewers (5): ce-correctness-reviewer, ce-testing-reviewer, ce-maintainability-reviewer, ce-julik-frontend-races-reviewer, ce-kieran-typescript-reviewer. The previous-comments reviewer was not dispatched — both prior comments are bot notices (Vercel, changeset-bot) with no substantive feedback to verify.

Testing gaps: The wait asserts the temporary page is gone, not that the saved dashboard's remote data has rendered; the fix relies on downstream waits (editDashboardName awaits a non-empty name input) to bridge the gap. A dropped testing finding claiming toBeHidden may not confirm the swap was refuted by source-level tracing (the button unmounts precisely on the isLocalDashboard flip) and is not carried as a defect.

No finding blocks merge automatically. A maintainer will expect P0/P1 findings in code this PR changes to be fixed; P2/P3 are your call -- fix or reply. Never fix findings about surrounding code here; reply instead. Do not widen the PR. How to respond

@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

E2E Test Results

✅ All tests passed • 512 passed • 1 skipped • 1051s

Status Count
✅ Passed 512
❌ Failed 0
⚠️ Flaky 1
⏭️ Skipped 1

Tests ran across 4 shards in parallel.

View full report →

@kodiakhq
kodiakhq Bot merged commit f23d776 into main Dec 4, 2026
32 of 34 checks passed
@kodiakhq
kodiakhq Bot deleted the drew/fix-dashboard-e2e-flakes branch December 4, 2026 14:24

This branch was successfully deployed

2 active deployments
Preview – hyperdx-oss — 6cf5742a Deployed Dec 4, 2026 by vercel[bot]
Preview – hyperdx-storybook — 6cf5742a Deployed Dec 4, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automerge review/tier-2 Low risk — AI review + quick human skim

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants