Skip to content

test(domains): fix flaky Rename domain with data products attached at domain and subdomain levels#27452

Merged
siddhant1 merged 4 commits intomainfrom
fix/rename-domain-with-data-products-flaky
Apr 17, 2026
Merged

test(domains): fix flaky Rename domain with data products attached at domain and subdomain levels#27452
siddhant1 merged 4 commits intomainfrom
fix/rename-domain-with-data-products-flaky

Conversation

@siddhant1
Copy link
Copy Markdown
Member

Summary

Stabilize Domains › Rename domain with data products attached at domain and subdomain levels (playwright/e2e/Pages/Domains.spec.ts:1974).

Root cause

In renameDomain (playwright/utils/domain.ts), after the PATCH resolves we immediately call page.reload(). The app updates the browser URL to the new FQN asynchronously from React state, so under load the reload can fire while the URL is still the old FQN. That reload hits a 404, the app redirects to /domain list, and the subsequent entity-header-name assertion times out against an empty page.

Seen in CI run 24541920436/1130/1: first attempt's screenshot shows "No data available" on the domains list at the moment toContainText failed (Domains.spec.ts:2033).

Fix

Wait for the URL to reflect the new name before reloading:

await patchRes;
await page.waitForURL((url) => url.pathname.includes(newName));

Note

There's a second flake surface in the same test — verifyDataProductsCount polls the data-product search index for 30s after rename and occasionally sees 0 where it expects 2 (the cascading reindex of domains.fullyQualifiedName on child data products is slow under CI load). That's a real backend-timing concern, not a test-logic race, and is left out of this PR intentionally. Worth tracking as a follow-up (either lift the poll budget or investigate whether the reindex cascade can be nudged).

Test plan

  • Run locally: npx playwright test Domains.spec.ts -g "Rename domain with data products" --repeat-each=5 --workers=1
  • Confirm other renameDomain callers still pass (the helper change only adds a wait, doesn't remove any step).

🤖 Generated with Claude Code

…t domain and subdomain levels"

Two races were observed in CI:

1. renameDomain reloaded the page before the browser URL had been
   updated to the new FQN, so the reload hit the old (now 404) URL and
   the app redirected to the domains list. Wait for the URL to reflect
   the new name before reloading.
2. The search-index reindex for data products can take longer than 30s
   when the parent domain is renamed under CI load. Raise the poll
   budget to 90s.
@siddhant1 siddhant1 requested a review from a team as a code owner April 17, 2026 05:58
Copilot AI review requested due to automatic review settings April 17, 2026 05:58
@github-actions
Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@siddhant1 siddhant1 added UI UI specific issues safe to test Add this label to run secure Github workflows on PRs To release Will cherry-pick this PR into the release branch labels Apr 17, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 Playwright test Domains › Rename domain with data products attached at domain and subdomain levels by preventing a reload from occurring before the SPA updates the browser URL to the renamed domain’s new route.

Changes:

  • Add a page.waitForURL(...) synchronization point after the rename PATCH completes to ensure the URL reflects the new domain name before reloading.

Comment thread openmetadata-ui/src/main/resources/ui/playwright/utils/domain.ts Outdated
Comment thread openmetadata-ui/src/main/resources/ui/playwright/utils/domain.ts Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 17, 2026 06:02
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@gitar-bot
Copy link
Copy Markdown

gitar-bot Bot commented Apr 17, 2026

Code Review ✅ Approved

Updates the Rename domain test case to resolve flakiness when data products are attached. No issues found.

Options

Display: compact → Showing less information.

Comment with these commands to change:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 1 out of 1 changed files in this pull request and generated 1 comment.

Comment thread openmetadata-ui/src/main/resources/ui/playwright/utils/domain.ts
@github-actions
Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 63%
63.74% (59637/93557) 43.66% (31380/71873) 46.76% (9432/20171)

@sonarqubecloud
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown
Contributor

🟡 Playwright Results — all passed (28 flaky)

✅ 3653 passed · ❌ 0 failed · 🟡 28 flaky · ⏭️ 89 skipped

Shard Passed Failed Flaky Skipped
🟡 Shard 1 473 0 7 4
🟡 Shard 2 649 0 2 7
🟡 Shard 3 651 0 5 1
🟡 Shard 4 632 0 2 27
🟡 Shard 5 609 0 2 42
🟡 Shard 6 639 0 10 8
🟡 28 flaky test(s) (passed on retry)
  • Features/DataAssetRulesDisabled.spec.ts › Verify the ApiEndpoint entity item action after rules disabled (shard 1, 1 retry)
  • Features/CustomizeDetailPage.spec.ts › Database Schema - customization should work (shard 1, 1 retry)
  • Features/CustomizeDetailPage.spec.ts › API Endpoint - customization should work (shard 1, 1 retry)
  • Flow/Metric.spec.ts › Verify Related Metrics Update (shard 1, 1 retry)
  • Flow/Tour.spec.ts › Tour should work from welcome screen (shard 1, 1 retry)
  • Flow/Tour.spec.ts › Tour should work from URL directly (shard 1, 1 retry)
  • Pages/UserCreationWithPersona.spec.ts › Create user with persona and verify on profile (shard 1, 1 retry)
  • Features/BulkEditEntity.spec.ts › Glossary (shard 2, 1 retry)
  • Features/ChangeSummaryBadge.spec.ts › AI badge should NOT appear for manually-edited descriptions (shard 2, 1 retry)
  • Features/RestoreEntityInheritedFields.spec.ts › Validate restore with Inherited domain and data products assigned (shard 3, 1 retry)
  • Features/RestoreEntityInheritedFields.spec.ts › Validate restore with Inherited domain and data products assigned (shard 3, 1 retry)
  • Features/RestoreEntityInheritedFields.spec.ts › Validate restore with Inherited domain and data products assigned (shard 3, 2 retries)
  • Features/RestoreEntityInheritedFields.spec.ts › Validate restore with Inherited domain and data products assigned (shard 3, 1 retry)
  • Features/RestoreEntityInheritedFields.spec.ts › Validate restore with Inherited domain and data products assigned (shard 3, 2 retries)
  • Pages/Customproperties-part2.spec.ts › entityReferenceList shows item count, scrollable list, no expand toggle (shard 4, 1 retry)
  • Pages/DataContractsSemanticRules.spec.ts › Validate Owner Rule Not_In (shard 4, 1 retry)
  • Pages/ExplorePageRightPanel.spec.ts › Should verify deleted user not visible in owner selection for topic (shard 5, 1 retry)
  • Pages/Glossary.spec.ts › Add and Remove Assets (shard 5, 2 retries)
  • Pages/HyperlinkCustomProperty.spec.ts › should display URL when no display text is provided (shard 6, 1 retry)
  • Pages/Lineage/DataAssetLineage.spec.ts › verify create lineage for entity - Container (shard 6, 1 retry)
  • Pages/Lineage/DataAssetLineage.spec.ts › verify create lineage for entity - Topic (shard 6, 1 retry)
  • Pages/Lineage/DataAssetLineage.spec.ts › verify create lineage for entity - Metric (shard 6, 1 retry)
  • Pages/Lineage/LineageFilters.spec.ts › Verify lineage schema filter selection (shard 6, 1 retry)
  • Pages/Lineage/LineageRightPanel.spec.ts › Verify custom properties tab IS visible for supported type: searchIndex (shard 6, 1 retry)
  • Pages/Users.spec.ts › Create and Delete user (shard 6, 1 retry)
  • Pages/Users.spec.ts › Permissions for table details page for Data Consumer (shard 6, 1 retry)
  • Pages/Users.spec.ts › Check permissions for Data Steward (shard 6, 1 retry)
  • VersionPages/EntityVersionPages.spec.ts › Directory (shard 6, 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

@siddhant1 siddhant1 merged commit 57e558d into main Apr 17, 2026
49 checks passed
@siddhant1 siddhant1 deleted the fix/rename-domain-with-data-products-flaky branch April 17, 2026 08:01
@github-actions
Copy link
Copy Markdown
Contributor

Changes have been cherry-picked to the 1.12.6 branch.

github-actions Bot pushed a commit that referenced this pull request Apr 17, 2026
… domain and subdomain levels (#27452)

* test(domains): fix flaky "Rename domain with data products attached at domain and subdomain levels"

Two races were observed in CI:

1. renameDomain reloaded the page before the browser URL had been
   updated to the new FQN, so the reload hit the old (now 404) URL and
   the app redirected to the domains list. Wait for the URL to reflect
   the new name before reloading.
2. The search-index reindex for data products can take longer than 30s
   when the parent domain is renamed under CI load. Raise the poll
   budget to 90s.

* Revert search-index poll timeout bump, keep only URL-wait fix

* Update openmetadata-ui/src/main/resources/ui/playwright/utils/domain.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update openmetadata-ui/src/main/resources/ui/playwright/utils/domain.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
(cherry picked from commit 57e558d)
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 To release Will cherry-pick this PR into the release branch UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants