Skip to content

fix: harden integration tests under parallel CI - #30060

Merged
harshach merged 26 commits into
mainfrom
fix/integration-test-hardening
Jul 15, 2026
Merged

harshach merged 26 commits into
mainfrom
fix/integration-test-hardening

Conversation

@harshach

@harshach harshach commented Jul 14, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • isolate shared Awaitility, settings, schema, glossary-relation, custom-property, and ordered-test state
  • replace sleeps and no-op waits with bounded assertions for search, extraction, event, and async-bulk visibility
  • make Elasticsearch and OpenSearch lineage builders initialize lazily on every lineage entry point
  • invalidate negative entity-cache entries after mutations and cover restore behavior with a regression test
  • derive search expectations from canonical settings, tolerate accounted stale-reindex warnings, and skip vector assertions when initialization genuinely fails
  • stabilize remaining MCP, OpenLineage, drive, index-template, data-product, table, metrics, and UI data-quality cases

Root cause

The integration profile runs more than 15,000 tests concurrently in one JVM against one OpenMetadata server. Several tests mutated process-wide or server-wide state without shared coordination, while others assumed asynchronous search, workflow, cache, or bulk work was immediately visible. Two product paths also left cache or lineage state uninitialized after valid lifecycle transitions.

Impact

The PostgreSQL/OpenSearch profile now completes at bounded parallelism without database saturation, shared-state lost updates, dangling async-bulk children, or timing-dependent search and workflow assertions. The production changes make entity mutation cache invalidation and lineage initialization durable outside the test suite as well.

Validation

  • mvn spotless:apply -pl :openmetadata-integration-tests
  • mvn -DskipTests clean install -pl :openmetadata-integration-tests -am
  • mvn -pl :openmetadata-service -Dtest=EntityRepositoryRestoreTest test — 16 tests passed
  • repeated glossary relation/RDF fixture suites — four clean executions
  • Redis restore hierarchy, stale reindex, table concurrency, user metrics, and async-bulk focused coverage passed
  • mvn verify -pl :openmetadata-integration-tests -Ppostgres-opensearch -Djunit.jupiter.execution.parallel.config.strategy=fixed -Djunit.jupiter.execution.parallel.config.fixed.parallelism=8 — 15,041 tests, 0 failures, 0 errors, 1,387 skipped
  • git diff --check

Greptile Summary

This PR hardens integration tests for parallel CI and updates a few production paths. The main changes are:

  • Shared locks and namespace cleanup for tests that mutate global state.
  • Bounded waits for search, extraction, event, workflow, and async bulk visibility.
  • Lazy lineage builder initialization for Elasticsearch and OpenSearch clients.
  • Cache invalidation after entity mutations and restore flows.
  • Regression coverage for restore cache behavior.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Important Files Changed

Filename Overview
openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/EntityRepository.java Adds registered cache-layer invalidation after entity mutation and restore cache updates.
openmetadata-service/src/main/java/org/openmetadata/service/search/elasticsearch/ElasticSearchClient.java Initializes the Elasticsearch lineage builder lazily from lineage entry points.
openmetadata-service/src/main/java/org/openmetadata/service/search/opensearch/OpenSearchClient.java Applies the same lazy lineage builder initialization to OpenSearch.
openmetadata-integration-tests/src/test/java/org/openmetadata/it/util/SharedResourceLocks.java Centralizes shared JUnit resource lock names for parallel integration tests.
openmetadata-integration-tests/src/test/java/org/openmetadata/it/util/TestNamespace.java Adds tracked root handling for namespace-based test cleanup.
openmetadata-integration-tests/src/test/java/org/openmetadata/it/util/TestNamespaceExtension.java Runs namespace cleanup through the JUnit extension lifecycle.

Reviews (2): Last reviewed commit: "test: sanitize copied Elasticsearch temp..." | Re-trigger Greptile

Context used (3)

  • Context used - CLAUDE.md (source)
  • Context used - openmetadata-ui-core-components/CLAUDE.md (source)
  • Context used - AGENTS.md (source)

@github-actions github-actions Bot added backend safe to test Add this label to run secure Github workflows on PRs labels Jul 14, 2026
@harshach
harshach marked this pull request as ready for review July 14, 2026 18:41
Copilot AI review requested due to automatic review settings July 14, 2026 18:41

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 commented Jul 14, 2026 •

Copy link
Copy Markdown
Contributor

🔴 Playwright Results — 1 failure(s), 26 flaky

✅ 4527 passed · ❌ 1 failed · 🟡 26 flaky · ⏭️ 96 skipped

Shard Passed Failed Flaky Skipped
🟡 Shard 1 423 0 4 16
✅ Shard 2 11 0 0 0
🔴 Shard 3 819 1 11 9
🟡 Shard 4 821 0 1 18
🟡 Shard 5 836 0 3 5
🟡 Shard 6 787 0 1 46
🟡 Shard 7 830 0 6 2

Genuine Failures (failed on all attempts)

❌ Features/ContextCenterPermission.spec.ts › created-by-me filter on the archive page shows only the current user's archived documents (shard 3)
�[31mTest timeout of 180000ms exceeded.�[39m
🟡 26 flaky test(s) (passed on retry)
  • Flow/TestConnectionModal.spec.ts › modal opens with gate card and capability checks sections (shard 1, 1 retry)
  • Pages/Lineage/LineageRightPanel.spec.ts › Verify custom properties tab IS visible for supported type: metric (shard 1, 1 retry)
  • Pages/SearchSettings.spec.ts › Preview config reflects reverted n-gram weight after save (shard 1, 2 retries)
  • Flow/SearchRBAC.spec.ts › a fully denied user sees neither asset type when browsing (shard 1, 1 retry)
  • Features/Announcements/AnnouncementEntity.spec.ts › creates an announcement on a domain (shard 3, 1 retry)
  • Features/BulkEditEntity.spec.ts › Database (shard 3, 1 retry)
  • Features/BulkImportWithDotInName.spec.ts › CSV with quoted FQN loads correctly in import grid (shard 3, 1 retry)
  • Features/ContextCenterArchivePage.spec.ts › archive page lazy-loads more rows on scroll within its own scroll container (shard 3, 1 retry)
  • Features/ContextCenterArticles.spec.ts › Article listing search filters, clears, and shows empty state (shard 3, 1 retry)
  • Features/ContextCenterArticles.spec.ts › Article list cards, recently viewed widget, and pagination work (shard 3, 1 retry)
  • Features/ContextCenterArticles.spec.ts › Article edit persistence and unsaved title behavior are correct (shard 3, 2 retries)
  • Features/ContextCenterArticles.spec.ts › description: switching articles does not bleed unsaved content into next article (shard 3, 1 retry)
  • Features/ContextCenterMemories.spec.ts › cancel button in edit mode closes the modal without saving (shard 3, 1 retry)
  • Features/ContextCenterMemories.spec.ts › data consumer sees a read-only modal for shared memories they do not own (shard 3, 1 retry)
  • Features/ContextCenterPermission.spec.ts › admin user can edit and save a memory owned by another user (shard 3, 1 retry)
  • Features/SearchExport.spec.ts › Export queues a background job and downloads from the jobs tray (shard 4, 1 retry)
  • Flow/ExploreDiscovery.spec.ts › Should display domain and owner of deleted asset in suggestions when showDeleted is on (shard 5, 1 retry)
  • Flow/PersonaFlow.spec.ts › Set default persona for team should work properly (shard 5, 1 retry)
  • Pages/CustomProperties.spec.ts › Time Interval (shard 5, 1 retry)
  • Pages/ExploreBrowse.spec.ts › service type drill-down disables unrelated roots and query-panel Clear resets it (shard 6, 1 retry)
  • Pages/ExplorePageRightPanel.spec.ts › Should allow Data Steward to edit tags for dashboardDataModel (shard 7, 1 retry)
  • Pages/Glossary.spec.ts › Create glossary with all optional fields (tags, owners, reviewers, domain) (shard 7, 1 retry)
  • Pages/Lineage/LineageFilters.spec.ts › Verify Impact Analysis service filter selection (shard 7, 1 retry)
  • Pages/Lineage/LineageRightPanel.spec.ts › Verify custom properties tab is NOT visible for pipelineService in platform lineage (shard 7, 1 retry)
  • Pages/Lineage/LineageRightPanel.spec.ts › Verify custom properties tab is NOT visible for apiService in platform lineage (shard 7, 1 retry)
  • Pages/TestSuite.spec.ts › Logical TestSuite (shard 7, 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

harshach added 2 commits July 14, 2026 16:36
…hardening

# Conflicts:
#	openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/search/TestCaseStaleDefinitionReindexIT.java
Copilot AI review requested due to automatic review settings July 14, 2026 23:44

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.

@sonarqubecloud

Copy link
Copy Markdown

@harshach
harshach merged commit e06fe0a into main Jul 15, 2026
68 of 73 checks passed
@harshach
harshach deleted the fix/integration-test-hardening branch July 15, 2026 03:57
@gitar-bot

gitar-bot Bot commented Jul 15, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Hardens integration tests by implementing shared resource locks, bounded asynchronous assertions, and improved namespace cleanup. Includes durable production fixes for entity cache invalidation and lazy lineage builder initialization.

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

harshach added a commit that referenced this pull request Jul 15, 2026
…ng-review

Resolved SystemResourceIT.java conflict by adopting main's canonical-driven
fieldValueBoost assertions (from #30060), which validate against the packaged
searchSettings.json instead of hardcoded factors and therefore hold for this
branch's retuned signal values.

Co-Authored-By: Claude Fable 5 <[email protected]>
@manerow manerow mentioned this pull request Jul 20, 2026
15 tasks done

This branch was previously deployed

1 inactive deployment
test — 518d17d1 Deployed Jul 14, 2026 by harshach via playwright-ci-postgresql (6, 7) #56523
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend safe to test Add this label to run secure Github workflows on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants