fix: 409 entity already exist issue in DataObservabilityGovernanceTab.spec.ts#27518
Merged
ShaileshParmar11 merged 2 commits intomainfrom Apr 19, 2026
Merged
fix: 409 entity already exist issue in DataObservabilityGovernanceTab.spec.ts#27518ShaileshParmar11 merged 2 commits intomainfrom
ShaileshParmar11 merged 2 commits intomainfrom
Conversation
harsh-vador
previously approved these changes
Apr 19, 2026
Contributor
There was a problem hiding this comment.
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
letdeclarations and moved construction intotest.beforeAll. - Added optional chaining in
test.afterAllto avoid teardownTypeErrorwhen setup fails early. - Kept entity creation/patch/testcase setup logic the same while changing lifecycle timing.
harsh-vador
approved these changes
Apr 19, 2026
Code Review ✅ ApprovedDataObservabilityGovernanceTab.spec.ts now handles 409 entity conflicts during test execution. No issues were found. OptionsDisplay: compact → Showing less information. Comment with these commands to change:
Was this helpful? React with 👍 / 👎 | Gitar |
Contributor
|
anuj-kumary
approved these changes
Apr 19, 2026
Contributor
🟡 Playwright Results — all passed (17 flaky)✅ 3668 passed · ❌ 0 failed · 🟡 17 flaky · ⏭️ 89 skipped
🟡 17 flaky test(s) (passed on retry)
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Fixes intermittent
409 Conflictfailures in theDataObservabilityGovernanceTabPlaywright spec by moving entity instantiation from module scope intobeforeAll, and guarding teardown against partial setup.Changes
classification,tag,glossary,glossaryTerm,domain,table) withletat module scope instead of constructing them inline.beforeAllso each test run (including retries) generates fresh randomized names.entity?.delete(apiContext)) inafterAllso teardown doesn't throw whenbeforeAllfails 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 intobeforeAllguarantees a fresh name per attempt.The optional-chaining change prevents cascading
TypeError: Cannot read properties of undefinedfailures inafterAllthat masked the real setup error.Test plan
yarn playwright test DataObservabilityGovernanceTab.spec.tspasses locallyyarn playwright test DataObservabilityGovernanceTab.spec.ts --retries=2passes (verifies retry scenario)beforeAllfailure and confirmafterAllcleans up what exists without throwingRelated
Closes https://github.com/open-metadata/openmetadata-collate/issues/3710