Skip to content

test(it): backport reindex external-IT hardening to 1.13 - #30589

Merged
mohityadav766 merged 1 commit into
1.13from
fix/1.13-reindex-it-test-hardening
Jul 28, 2026
Merged

test(it): backport reindex external-IT hardening to 1.13#30589
mohityadav766 merged 1 commit into
1.13from
fix/1.13-reindex-it-test-hardening

Conversation

@mohityadav766

@mohityadav766 mohityadav766 commented Jul 28, 2026

Copy link
Copy Markdown
Member

What

Backports main's hardened versions of three external-cluster reindex ITs that flake on the shared search-release-dev nightly cluster.

  • ReindexStatsIT — delete the orphaned table in a finally block so it can't skew the cluster-wide DbToEsCountReconciliationIT (table db=2/es=1); balance the sink assertion on processed.successRecords.
  • DbToEsCountReconciliationIT — poll DB↔ES counts with Awaitility (ReindexHelpers.searchPropagationTimeout) instead of a one-shot read that fails under nightly load while the engine refresh lags a beat.
  • SelectiveFieldReindexUIIT — assert testCase/testSuite presence via deterministic search-index counts instead of rendering the heavy /data-quality dashboard page.

Why

On the nightly 1.13 external run these three flake/fail where main is green. The stale (pre-hardening) 1.13 versions leave an orphan table that cascades into DbToEsCountReconciliationIT, and do one-shot / heavy-page reads that time out under load. Files taken verbatim from main; all referenced helpers (SearchAssertions.countByNamePrefix, IndexAliasInspector.indexNameFor, ReindexHelpers.searchPropagationTimeout) already exist on 1.13.

Test

mvn spotless:check -pl :openmetadata-integration-tests passes. These are the same versions already green on main's nightly.

🤖 Generated with Claude Code

Greptile Summary

This PR hardens three search reindex integration tests against shared-cluster timing and state leakage.

  • Polls DB-to-search count reconciliation until index refresh propagation completes.
  • Deletes the deliberately orphaned table in a finally block and aligns processor-to-sink accounting.
  • Replaces expensive data-quality page rendering with deterministic, run-specific search-index checks.

Confidence Score: 4/5

The PR is safe to merge, with a non-blocking cleanup gap that leaves ancillary orphan metadata in shared test state.

The reindex polling and search assertions preserve their intended coverage, while the new raw table DAO deletion removes only the entity row and bypasses cleanup of related metadata and search state.

Files Needing Attention: openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/search/ReindexStatsIT.java

Important Files Changed

Filename Overview
openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/search/DbToEsCountReconciliationIT.java Extracts count collection and retries reconciliation during the bounded search-propagation window.
openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/search/ReindexStatsIT.java Corrects stage accounting and removes the orphaned table row, but the raw DAO deletion leaves associated metadata and search state behind.
openmetadata-integration-tests/src/test/java/org/openmetadata/playwright/scenarios/search/reindex/SelectiveFieldReindexUIIT.java Replaces flaky data-quality dashboard interactions with polling assertions against uniquely named test-case and test-suite search documents.

Reviews (1): Last reviewed commit: "test(it): backport reindex external-IT h..." | Re-trigger Greptile

Greptile also left 1 inline comment on this PR.

Cherry-pick main's hardened versions of three external-cluster reindex
tests that flake on the shared search-release-dev cluster:

- ReindexStatsIT: delete the orphaned table in a finally block so it
  cannot skew the cluster-wide DbToEsCountReconciliationIT (table
  db=2/es=1); balance the sink assertion on processed.successRecords.
- DbToEsCountReconciliationIT: poll DB<->ES counts with Awaitility
  (searchPropagationTimeout) instead of a one-shot read that fails under
  nightly load while the engine refresh lags a beat.
- SelectiveFieldReindexUIIT: assert testCase/testSuite presence via
  deterministic search-index counts instead of rendering the heavy
  /data-quality dashboard page.

Helpers referenced (SearchAssertions.countByNamePrefix,
IndexAliasInspector.indexNameFor, ReindexHelpers.searchPropagationTimeout)
already exist on 1.13.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@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 added backend safe to test Add this label to run secure Github workflows on PRs labels Jul 28, 2026
@gitar-bot

gitar-bot Bot commented Jul 28, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Backports hardened external-cluster reindex integration tests from main to eliminate nightly test flakes in 1.13. No issues found.

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 | Powered by Gitar — free for open source

// broken chain, leaving a non-deleted, unindexable table on the shared cluster that later
// skews the cluster-wide DbToEsCountReconciliationIT (table db=2/es=1). Remove it directly,
// mirroring the DAO-level surgery used to create the orphan.
Entity.getCollectionDAO().tableDAO().delete(table.getId());

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 Cleanup leaves orphan metadata

tableDAO().delete(table.getId()) removes only the table row, bypassing repository cleanup for relationships, extensions, tags, usage data, and the search document. The test therefore replaces the leaked table with ancillary orphan records that remain in the shared test state; use the repository-level hard-delete path or explicitly remove all associated state.

@mohityadav766
mohityadav766 merged commit cd5cf25 into 1.13 Jul 28, 2026
49 of 79 checks passed
@mohityadav766
mohityadav766 deleted the fix/1.13-reindex-it-test-hardening branch July 28, 2026 18:33
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.

1 participant