Skip to content

fix: 409 entity already exist issue in DataObservabilityGovernanceTab.spec.ts#27518

Merged
ShaileshParmar11 merged 2 commits intomainfrom
fix-dq-dashboard
Apr 19, 2026
Merged

fix: 409 entity already exist issue in DataObservabilityGovernanceTab.spec.ts#27518
ShaileshParmar11 merged 2 commits intomainfrom
fix-dq-dashboard

Conversation

@ShaileshParmar11
Copy link
Copy Markdown
Contributor

@ShaileshParmar11 ShaileshParmar11 commented Apr 19, 2026

Summary

Fixes intermittent 409 Conflict failures in the DataObservabilityGovernanceTab Playwright spec by moving entity instantiation from module scope into beforeAll, and guarding teardown against partial setup.

Changes

  • Declare test entities (classification, tag, glossary, glossaryTerm, domain, table) with let at module scope instead of constructing them inline.
  • Instantiate entities inside beforeAll so each test run (including retries) generates fresh randomized names.
  • Use optional chaining (entity?.delete(apiContext)) in afterAll so teardown doesn't throw when beforeAll fails before all entities are created.

Why

Module-scope construction runs once per worker process. On retries the constructors are not re-invoked, so the same randomized names are reused — the server already has those entities from the previous attempt and responds with 409 Conflict. Moving construction into beforeAll guarantees a fresh name per attempt.

The optional-chaining change prevents cascading TypeError: Cannot read properties of undefined failures in afterAll that masked the real setup error.

Test plan

  • yarn playwright test DataObservabilityGovernanceTab.spec.ts passes locally
  • yarn playwright test DataObservabilityGovernanceTab.spec.ts --retries=2 passes (verifies retry scenario)
  • Simulate a mid-beforeAll failure and confirm afterAll cleans up what exists without throwing
  • CI Playwright job green

Related

Closes https://github.com/open-metadata/openmetadata-collate/issues/3710

Copilot AI review requested due to automatic review settings April 19, 2026 06:07
@ShaileshParmar11 ShaileshParmar11 requested a review from a team as a code owner April 19, 2026 06:07
@github-actions github-actions bot added safe to test Add this label to run secure Github workflows on PRs UI UI specific issues labels Apr 19, 2026
harsh-vador
harsh-vador previously approved these changes Apr 19, 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 updates a Playwright E2E spec to reduce intermittent 409 Conflict failures on retries by ensuring test entities are instantiated within beforeAll (per attempt) rather than at module scope, and by making teardown more tolerant of setup failures.

Changes:

  • Converted module-scope entity instances to let declarations and moved construction into test.beforeAll.
  • Added optional chaining in test.afterAll to avoid teardown TypeError when setup fails early.
  • Kept entity creation/patch/testcase setup logic the same while changing lifecycle timing.

@gitar-bot
Copy link
Copy Markdown

gitar-bot bot commented Apr 19, 2026

Code Review ✅ Approved

DataObservabilityGovernanceTab.spec.ts now handles 409 entity conflicts during test execution. No issues were found.

Options

Display: compact → Showing less information.

Comment with these commands to change:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@github-actions
Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 63%
63.73% (59682/93636) 43.69% (31456/71994) 46.75% (9446/20204)

@sonarqubecloud
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown
Contributor

🟡 Playwright Results — all passed (17 flaky)

✅ 3668 passed · ❌ 0 failed · 🟡 17 flaky · ⏭️ 89 skipped

Shard Passed Failed Flaky Skipped
🟡 Shard 1 478 0 2 4
🟡 Shard 2 649 0 2 7
🟡 Shard 3 653 0 7 1
🟡 Shard 4 633 0 1 27
🟡 Shard 5 610 0 1 42
🟡 Shard 6 645 0 4 8
🟡 17 flaky test(s) (passed on retry)
  • Features/CustomizeDetailPage.spec.ts › Database Schema - customization should work (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, 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/RTL.spec.ts › Verify Following widget functionality (shard 3, 1 retry)
  • Features/TestSuitePipelineRedeploy.spec.ts › Re-deploy all test-suite ingestion pipelines (shard 3, 1 retry)
  • Pages/Customproperties-part2.spec.ts › entityReferenceList shows item count, scrollable list, no expand toggle (shard 4, 1 retry)
  • Pages/Glossary.spec.ts › Add and Remove Assets (shard 5, 1 retry)
  • Pages/Glossary.spec.ts › Column dropdown drag-and-drop functionality for Glossary Terms table (shard 6, 1 retry)
  • Pages/Lineage/DataAssetLineage.spec.ts › Column lineage for dashboard -> topic (shard 6, 1 retry)
  • Pages/Lineage/LineageFilters.spec.ts › Verify lineage schema filter selection (shard 6, 1 retry)
  • Pages/Users.spec.ts › Permissions for table details page for Data Consumer (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

@ShaileshParmar11 ShaileshParmar11 merged commit 62362d7 into main Apr 19, 2026
48 of 49 checks passed
@ShaileshParmar11 ShaileshParmar11 deleted the fix-dq-dashboard branch April 19, 2026 11:20
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.

4 participants