test(it): backport reindex external-IT hardening to 1.13 - #30589
Conversation
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>
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
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 |
Code Review ✅ ApprovedBackports hardened external-cluster reindex integration tests from main to eliminate nightly test flakes in 1.13. No issues found. OptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
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()); |
There was a problem hiding this comment.
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.
What
Backports
main's hardened versions of three external-cluster reindex ITs that flake on the sharedsearch-release-devnightly cluster.finallyblock so it can't skew the cluster-wideDbToEsCountReconciliationIT(table db=2/es=1); balance the sink assertion onprocessed.successRecords.ReindexHelpers.searchPropagationTimeout) instead of a one-shot read that fails under nightly load while the engine refresh lags a beat./data-qualitydashboard page.Why
On the nightly 1.13 external run these three flake/fail where
mainis green. The stale (pre-hardening) 1.13 versions leave an orphan table that cascades intoDbToEsCountReconciliationIT, and do one-shot / heavy-page reads that time out under load. Files taken verbatim frommain; all referenced helpers (SearchAssertions.countByNamePrefix,IndexAliasInspector.indexNameFor,ReindexHelpers.searchPropagationTimeout) already exist on 1.13.Test
mvn spotless:check -pl :openmetadata-integration-testspasses. These are the same versions already green onmain's nightly.🤖 Generated with Claude Code
Greptile Summary
This PR hardens three search reindex integration tests against shared-cluster timing and state leakage.
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
Reviews (1): Last reviewed commit: "test(it): backport reindex external-IT h..." | Re-trigger Greptile