Skip to content

test(e2e): use route.fallback in ETag strip so spec mocks still apply#30413

Open
ShaileshParmar11 wants to merge 7 commits into
mainfrom
claude/playwright-test-failure-1f8mcx
Open

test(e2e): use route.fallback in ETag strip so spec mocks still apply#30413
ShaileshParmar11 wants to merge 7 commits into
mainfrom
claude/playwright-test-failure-1f8mcx

Conversation

@ShaileshParmar11

@ShaileshParmar11 ShaileshParmar11 commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Describe your changes:

Follow-up to #30371, which introduced stripEtagConditionalReads.

What / why: The ETag strip added in #30371 registered a catch-all page.route('**/api/v1/**') that removed If-None-Match and then called route.continue(). Because Playwright evaluates matching route handlers in reverse registration order (last-registered runs first) and route.continue() terminates the chain, and because the strip is installed via redirectToHomePage after each spec registers its own more-specific route.fulfill() mocks, the catch-all ran first and shadowed those mocks — forwarding the request to the real backend instead of the mocked response.

Change: Switch the strip to route.fallback({ headers }) — Playwright's documented idiom for modifying headers on every request while still allowing other handlers to run. The header is stripped and control defers to the earlier spec-specific mocks; when no other handler exists, fallback continues to the network with the stripped headers, so the original anti-stale-read behavior is byte-for-byte unchanged.

Type of change:

  • Bug fix

High-level design:

N/A — small test-infra change.

Tests:

Use cases covered

Unit tests

Not applicable.

Backend integration tests

  • Not applicable (no backend API changes).

Ingestion integration tests

  • Not applicable (no ingestion changes).

Playwright (UI) tests

  • Fixed openmetadata-ui/.../playwright/utils/common.ts (route.continueroute.fallback)
  • Re-enabled openmetadata-ui/.../playwright/e2e/Features/ServiceAgentsPauseResume.spec.ts

Manual testing performed

End-to-end confirmation is the Playwright CI run on this branch. The mechanism is verified against Playwright's route-chain semantics: reverse-order handler evaluation + fallback deferring to earlier handlers while preserving header overrides.

UI screen recording / screenshots:

Not applicable — test-only change.

Checklist:

  • I have read the CONTRIBUTING document.
  • I have commented on my code, particularly in hard-to-understand areas.
  • I have added/updated tests.

🤖 Generated with Claude Code


Summary by Gitar

  • Test infrastructure:
    • Updated waitForIncidentToBeIndexed utility to poll TestCase search for cleared incidentId when verifying resolved status
    • Fixed Data Quality dashboard E2E test assertions for resolved incidents and re-enabled ServiceAgentsPauseResume spec

This will update automatically on new commits.

Greptile Summary

This PR updates Playwright E2E coverage for service-agent pause behavior and resolved data-quality incidents.

  • Reworks the service-agent test to use the shared database service, mock toggle and refresh requests, and verify the paused state.
  • Polls the TestCase search index for a cleared incidentId before continuing after an incident is resolved.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/ServiceAgentsPauseResume.spec.ts Reworks the pause/resume E2E setup around stateful API mocks and direct navigation to the shared service’s metadata-agent tab.
openmetadata-ui/src/main/resources/ui/playwright/utils/dataQuality.ts Changes resolved-incident synchronization to wait for the target TestCase search document to have no incident ID.

Reviews (6): Last reviewed commit: "Work on the comments" | Re-trigger Greptile

The stripEtagConditionalReads catch-all page.route('**/api/v1/**') used
route.continue(), which terminates Playwright's route chain and sends the
request straight to the network. Because Playwright evaluates matching
handlers in reverse registration order and the strip is installed via
redirectToHomePage after each spec registers its own more-specific
route.fulfill() mocks, the catch-all ran first and shadowed those mocks —
forwarding /api/v1/rdf/** and /api/v1/services/ingestionPipelines/** to the
real backend.

Switch to route.fallback({ headers }) so the header is stripped and control
still defers to the earlier spec-specific mocks. Re-enable the two suites
that were skipped as a reaction to this regression.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013urWrUkaz75D39KfW3Z84o
@ShaileshParmar11
ShaileshParmar11 requested a review from a team as a code owner July 23, 2026 19:21
Copilot AI review requested due to automatic review settings July 23, 2026 19:21

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically.

Maintainers can bypass this check by adding the skip-pr-checks label.

@github-actions github-actions Bot added safe to test Add this label to run secure Github workflows on PRs UI UI specific issues labels Jul 23, 2026
Revert the un-skip of the RDF exports block. The route.fallback fix in
common.ts still applies, but leave this suite disabled for now.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013urWrUkaz75D39KfW3Z84o
Copilot AI review requested due to automatic review settings July 23, 2026 19:27

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

🔴 Playwright Results — workflow failed

Validated commit 9a92610f01a387313980f6df6a8d83ebea8bbc28 in Playwright run 30084409774, attempt 1.

✅ 536 passed · ❌ 1 failed · 🟡 1 flaky · ⏭️ 5 skipped · 🧰 0 lifecycle flaky

Performance

Blocking targets: ✅ met · Optimization targets: 🟡 in progress

Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting.

🕒 Full workflow signal wall (to summary) 50m 38s

⏱️ Max setup 2m 56s · max shard execution 15m 19s · max shard-job elapsed before upload 19m 42s · reporting 5s

🌐 199.83 requests/attempt · 2.86 app boots/UI scenario · 13.49% common-shard skew

Optimization targets still in progress:

  • Application boot ratio was 2.86 per UI scenario (1606 boots / 561 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
✅ Shard chromium-01 85 0 0 0 0 0
🟡 Shard chromium-02 100 0 1 0 0 0
✅ Shard chromium-03 111 0 0 0 0 0
🔴 Shard chromium-04 102 1 0 3 0 0
✅ Shard data-asset-rules-01 61 0 0 0 0 0
✅ Shard domain-isolation-01 14 0 0 0 0 0
✅ Shard global-state-01 23 0 0 0 0 0
✅ Shard ingestion-01 1 0 0 0 0 0
✅ Shard reindex-01 2 0 0 0 0 0
✅ Shard search-01 10 0 0 0 0 0
✅ Shard search-rbac-01 27 0 0 2 0 0

Genuine Failures (failed on all attempts)

Features/ServiceAgentsPauseResume.spec.tsshould offer pause for an enabled agent and resume in disabled state (shard chromium-04)
Error: �[2mexpect(�[22m�[31mlocator�[39m�[2m).�[22mtoBeVisible�[2m(�[22m�[2m)�[22m failed  Locator: locator('[data-testid^="agent-card-"][data-testid*="pw-pause-resume-3ce444dd"]') Expected: visible Timeout: 15000ms Error: element(s) not found  Call log: �[2m  - Expect "toBeVisible" with timeout 15000ms�[22m �[2m  - waiting for locator('[data-testid^="agent-card-"][data-testid*="pw-pause-resume-3ce444dd"]')�[22m 
🟡 1 flaky test(s) (passed on retry)
  • Pages/Entity.spec.tsDomain Propagation (shard chromium-02, 1 retry)

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

anuj-kumary
anuj-kumary previously approved these changes Jul 24, 2026
Copilot AI review requested due to automatic review settings July 24, 2026 05:36

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.

Copilot was unable to review this pull request because the user who requested the review is ineligible. To be eligible to request a review, you need a paid Copilot license, or your organization must enable Copilot code review.

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings July 24, 2026 07:29

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings July 24, 2026 09:50

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings July 24, 2026 09:56

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@gitar-bot

gitar-bot Bot commented Jul 24, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 1 resolved / 1 findings

Switches the Playwright ETag-stripping route handler from route.continue() to route.fallback(), allowing spec-specific mocks to execute correctly. No issues found.

✅ 1 resolved
Quality: Unused isOpen=false branch in openCloseAgentActions

📄 openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/ServiceAgentsPauseResume.spec.ts:78-85
openCloseAgentActions(page, isOpen=false) is never invoked with false in this spec (the second test that used the close/no-wait path was removed), so the isOpen parameter and its conditional are dead code, and the helper name implies a close behavior it doesn't implement. Consider simplifying it back to an open-only helper (e.g. openAgentActions) or removing the unused parameter to keep the intent clear.

Options

Display: compact → Showing less information.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants