Skip to content

Fix the ServiceIngestion and Entity spec AUT failiures#29176

Open
aniketkatkar97 wants to merge 2 commits into
mainfrom
fix-service-ingestion-tests
Open

Fix the ServiceIngestion and Entity spec AUT failiures#29176
aniketkatkar97 wants to merge 2 commits into
mainfrom
fix-service-ingestion-tests

Conversation

@aniketkatkar97

@aniketkatkar97 aniketkatkar97 commented Jun 18, 2026

Copy link
Copy Markdown
Member

Fixes #29175

This pull request improves the reliability and readability of Playwright utility functions for entity interactions by refining how UI elements are interacted with and how retry logic is handled. The changes focus on making UI automation less prone to failures caused by tooltips and improving the robustness of the soft deletion verification process.

UI interaction reliability improvements:

  • In visitEntityPage, replaced the previous workaround for tooltip overlap (hovering and force-clicking) with a more reliable approach: moving the mouse to the top-left of the page to dismiss tooltips before performing a standard click on the entity name. This reduces flaky test failures due to tooltip interference.

Robust retry logic for deletion checks:

  • In softDeleteEntity, refactored the manual retry loop for checking the "deleted" badge into Playwright's expect.poll with configurable intervals and timeout. This makes the check more robust, readable, and easier to maintain.

Greptile Summary

This PR addresses flaky Playwright test failures in ServiceIngestion and entity spec tests by refining two utility functions in entity.ts. The tooltip-dismissal strategy in visitEntityPage is simplified (replacing hover + force-click with a mouse-to-origin move and a standard click), and the deleted-badge polling loop in softDeleteEntity is migrated to Playwright's idiomatic expect.poll API.

  • visitEntityPage: Drops force: true and the prior hover workaround; instead moves the mouse to body position (0, 0) before the click, which is a more reliable way to dismiss transient tooltips without bypassing Playwright's overlap detection.
  • softDeleteEntity: Replaces a manual while loop (≤ 5 reload attempts, no timeout) with expect.poll (120 s timeout, ascending retry intervals of 5 s → 10 s → 15 s), giving the check a clear timeout, a descriptive failure message, and making it easier to maintain.

Confidence Score: 5/5

Safe to merge; changes are scoped to Playwright test utilities with no production code path affected.

Both changes are self-contained improvements to test utility helpers. The visitEntityPage tooltip fix removes a linting suppression and the unreliable force-click. The softDeleteEntity migration to expect.poll is a strict improvement in clarity and robustness over the raw while loop, with the same eventual correctness guarantees. No application logic is touched.

No files require special attention.

Important Files Changed

Filename Overview
openmetadata-ui/src/main/resources/ui/playwright/utils/entity.ts Two targeted changes: tooltip-dismissal strategy in visitEntityPage simplified to mouse-origin hover + standard click (removes force: true); softDeleteEntity manual retry loop replaced with expect.poll. One minor concern: the internal reload uses waitUntil: 'domcontentloaded' which resolves before the SPA is fully hydrated, though waitForAllLoadersToDisappear partially mitigates this.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
    participant Test
    participant Page
    participant Server

    Note over Test,Server: softDeleteEntity flow

    Test->>Page: click confirm-button
    Server-->>Test: deleteResponse (API 200)
    Test->>Page: toastNotification check
    Test->>Page: reload() + waitForAllLoadersToDisappear()

    loop expect.poll (timeout: 120s, intervals: 5s→10s→15s)
        Test->>Page: isVisible('[deleted-badge]')?
        alt Badge already visible
            Page-->>Test: true → poll resolves
        else Badge not visible
            Test->>Page: "reload({ waitUntil: 'domcontentloaded' })"
            Test->>Page: waitForAllLoadersToDisappear()
            Test->>Page: isVisible('[deleted-badge]')?
            Page-->>Test: true / false
        end
    end

    Test->>Page: expect toHaveText('Deleted')
    Test->>Page: deletedEntityCommonChecks (deleted: true)
    Test->>Page: restoreEntity()
    Test->>Page: reload() + waitForAllLoadersToDisappear()
    Test->>Page: deletedEntityCommonChecks (deleted: false)
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
    participant Test
    participant Page
    participant Server

    Note over Test,Server: softDeleteEntity flow

    Test->>Page: click confirm-button
    Server-->>Test: deleteResponse (API 200)
    Test->>Page: toastNotification check
    Test->>Page: reload() + waitForAllLoadersToDisappear()

    loop expect.poll (timeout: 120s, intervals: 5s→10s→15s)
        Test->>Page: isVisible('[deleted-badge]')?
        alt Badge already visible
            Page-->>Test: true → poll resolves
        else Badge not visible
            Test->>Page: "reload({ waitUntil: 'domcontentloaded' })"
            Test->>Page: waitForAllLoadersToDisappear()
            Test->>Page: isVisible('[deleted-badge]')?
            Page-->>Test: true / false
        end
    end

    Test->>Page: expect toHaveText('Deleted')
    Test->>Page: deletedEntityCommonChecks (deleted: true)
    Test->>Page: restoreEntity()
    Test->>Page: reload() + waitForAllLoadersToDisappear()
    Test->>Page: deletedEntityCommonChecks (deleted: false)
Loading

Reviews (2): Last reviewed commit: "Worked on comments" | Re-trigger Greptile

@aniketkatkar97 aniketkatkar97 self-assigned this Jun 18, 2026
@aniketkatkar97 aniketkatkar97 requested a review from a team as a code owner June 18, 2026 10:19
Copilot AI review requested due to automatic review settings June 18, 2026 10:19
@aniketkatkar97 aniketkatkar97 added the To release Will cherry-pick this PR into the release branch label Jun 18, 2026
@github-actions github-actions Bot added safe to test Add this label to run secure Github workflows on PRs UI UI specific issues labels Jun 18, 2026
@open-metadata open-metadata deleted a comment from github-actions Bot Jun 18, 2026
Comment thread openmetadata-ui/src/main/resources/ui/playwright/utils/entity.ts
deletedBadge = page.locator('[data-testid="deleted-badge"]');
}
}
await page.reload({ waitUntil: 'domcontentloaded' });

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.

P2 The reload inside the poll uses waitUntil: 'domcontentloaded', which resolves as soon as the HTML is parsed — well before the SPA's React tree has hydrated or async data requests have completed. The original code always called waitForAllLoadersToDisappear after every reload. While the interval between polls provides some buffer, on slower CI environments the isVisible() check on the very next iteration could fire before the app is ready, causing a spurious extra cycle. Using 'networkidle' (or 'load') would be closer to the original contract and more reliable.

Suggested change
await page.reload({ waitUntil: 'domcontentloaded' });
await page.reload({ waitUntil: 'networkidle' });

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 targets flaky Playwright E2E behavior by improving entity page navigation reliability (tooltip overlap) and by refactoring the soft-delete “deleted badge” verification into a polling-based retry strategy.

Changes:

  • Updated visitEntityPage to dismiss tooltips by moving the mouse away before clicking the entity name.
  • Replaced a manual retry loop in softDeleteEntity with expect.poll to make deletion verification more robust and maintainable.

Comment on lines +2053 to +2056
await page.reload({ waitUntil: 'domcontentloaded' });

await expect(deletedBadge).toHaveText('Deleted');
return false;
},
Rohit0301
Rohit0301 previously approved these changes Jun 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 62%
62.28% (66607/106947) 44.04% (37261/84607) 45.38% (11189/24653)

@gitar-bot

gitar-bot Bot commented Jun 18, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Refactors Playwright utility functions to improve test stability by dismissing tooltips and replacing manual retry loops with expect.poll. The implementation successfully addresses test flakiness in ServiceIngestion and Entity specs with no open issues.

Options

Display: compact → Showing less information.

Comment with these commands to change:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown
Contributor

🟡 Playwright Results — all passed (12 flaky)

✅ 4302 passed · ❌ 0 failed · 🟡 12 flaky · ⏭️ 88 skipped

Shard Passed Failed Flaky Skipped
✅ Shard 1 302 0 0 4
🟡 Shard 2 811 0 1 9
🟡 Shard 3 811 0 5 8
🟡 Shard 4 854 0 3 12
🟡 Shard 5 732 0 1 47
🟡 Shard 6 792 0 2 8
🟡 12 flaky test(s) (passed on retry)
  • Features/DataQuality/ColumnLevelTests.spec.ts › Column Values To Not Match Regex (shard 2, 1 retry)
  • Features/IncidentManager.spec.ts › Complete Incident lifecycle with table owner (shard 3, 1 retry)
  • Features/KnowledgeCenterList.spec.ts › Knowledge Center List - Verify Recently Viewed widget (shard 3, 1 retry)
  • Features/KnowledgeCenterTextEditor.spec.ts › Rich Text Editor - Text Formatting (shard 3, 1 retry)
  • Features/UserProfileOnlineStatus.spec.ts › Should not show online status for inactive users (shard 3, 1 retry)
  • Features/Workflows/WorkflowOssRestrictions.spec.ts › exclude-fields-select is enabled in OSS (shard 3, 1 retry)
  • Pages/AppStopRunModal.spec.ts › should open stop modal when stop button is clicked and call stop API with runId (shard 4, 1 retry)
  • Pages/DataContracts.spec.ts › Create Data Contract and validate for Table (shard 4, 1 retry)
  • Pages/DataContractsSemanticRules.spec.ts › Validate Description Rule Is_Not_Set (shard 4, 1 retry)
  • Pages/ExplorePageRightPanel_KnowledgeCenter.spec.ts › Should remove user owner for knowledgeCenter (shard 5, 1 retry)
  • Pages/Lineage/LineageFilters.spec.ts › Verify lineage service filter selection (shard 6, 1 retry)
  • Pages/Lineage/LineageFilters.spec.ts › Verify lineage schema filter selection (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

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.

Fix the AUT failures

3 participants