Skip to content

fix(1.13): clear the pre-existing Java IT failures blocking every backport PR - #32446

Closed
mohityadav766 wants to merge 4 commits into
1.13from
fix/1.13-it-green
Closed

mohityadav766 wants to merge 4 commits into
1.13from
fix/1.13-it-green

Conversation

@mohityadav766

Copy link
Copy Markdown
Member

Describe your changes:

Every PR that targets 1.13 currently fails the Java integration-test lanes with the same ~9 failures, whatever the PR actually contains. Reproduced on two unrelated backports — #32391 (Pub/Sub credential masking, +62/-0 under secrets/converter) and #32400 (Glue databaseName) — both reporting the byte-identical 12739 tests run, 1192 skipped, 9 failed on mysql-elasticsearch, global-state with the same nine test names. This is a branch condition, not a property of the PR under test.

Root cause: 1.13 received the product backports but not the follow-up test-stabilization commits that landed on main, plus one product guard that main carried inside an unrelated PR. main and 2.0 are byte-identical on all of these files, which is why both are green.

Failure Root cause Missing from 1.13
TestCaseDeleteResilienceIT ×3 postDelete on an orphan test case reaches copyTestSuite(null) → NPE on TestSuite.getConnection() → 500 09af9fc801 (#27997)
IngestionPipelineOwnerInheritanceIT.test_killRequiresEditPermission asserts jakarta.ws.rs.ForbiddenException, which the SDK client never throws 51ecf4502f (#25894)
WorkflowTriggerPermissionsIT ×2 SubjectCache miss → EntityNotFoundException → 404 short-circuits the authorizer before it can return 403 96f445146e (#28513)
ColumnSearchIndexIT ×1–5 generic q= multi-matches name.ngram; siblings sharing the run prefix trip minimum-should-match 1e8dafbf33 (#31196)
UserMetricsResourceIT ×2 last_activity is a cluster-wide MAX, so a 10-minute wall-clock bound is arbitrary on a quiet lane #30060, #30120

Two of these are worth calling out because they are not ordinary flakes:

UserTestFactory is included as a prerequisite, not a drive-by: on 1.13 getOrCreateUser looks the user up by email instead of name, so getDataConsumer 404s, retries a create that 409s, and throws RuntimeException. Without it the WorkflowTriggerPermissionsIT @BeforeAll fails the entire class instead of fixing two tests.

Every hunk is taken from PR #32340 byte for byte, so this does not conflict when that lands.

Type of change:

  • Bug fix

Checklist:

  • I have read the CONTRIBUTING document.
  • I have commented on my code, particularly in hard-to-understand areas.

Testing

Built and ran locally against the mysql-elasticsearch profile (testcontainers MySQL 8.3.0 + Elasticsearch 9.3.0), in both the sequential-tests and parallel-tests failsafe phases — the parallel phase matters, because the WorkflowTriggerPermissionsIT and ColumnSearchIndexIT failures are concurrency- and order-dependent.

TestCaseDeleteResilienceIT               6/6    0 failures
UserMetricsResourceIT                    8/8    0 failures
WorkflowTriggerPermissionsIT            10/10   0 failures
IngestionPipelineOwnerInheritanceIT      4/4    0 failures
ColumnSearchIndexIT (all nested)        11/11   0 failures
                                        ─────
                    39 tests, 0 failures, 0 errors — BUILD SUCCESS

mvn install -pl openmetadata-service, mvn test-compile -pl openmetadata-integration-tests and mvn spotless:check on both modules are all BUILD SUCCESS.

Scope

Measured against #32400's twelve lanes, this clears 116 of 151 lane-failures and takes every mysql-elasticsearch lane green:

(mysql-elasticsearch, global-state)      9 fixed   0 left
(mysql-elasticsearch, multi-node)        7 fixed   0 left
(mysql-elasticsearch, parallel)          7 fixed   0 left
(mysql-elasticsearch, retry-queue)       9 fixed   1 left   AuditLogResourceIT
(postgres-opensearch, ×4)            11-14 fixed 1-6 left   GlossaryResourceIT, MlModelResourceIT
(postgres-elasticsearch-redis, ×4)     7-9 fixed 4-6 left   Classification/Container/Domain/GlossaryTermMove

The remaining 35 are deliberately out of scope here. They are two distinct families that map onto the other files in #32340 — FQN-rename cache invalidation (Classification/Container/Domain/Glossary/GlossaryTermMove all share the single root cause of stale L1/Redis state after the FQN rewrite) and parallel test isolation (MlModelResourceIT "mlmodelService not found", DashboardDataModelResourceIT, AuditLogResourceIT pagination). Duplicating those here would fork a 30-file PR that is already written and mergeable.

This PR is the subset worth landing first — five test files plus one seven-line product guard — so that #32391 and every other in-flight 1.13 backport stops being blocked on review of the riskier EntityRepository / SearchRepository / cache changes. #32340 remains the path to full green on the postgres lanes.

🤖 Generated with Claude Code

…icsearch lane

Every 1.13 PR shows the same ~9 integration-test failures regardless of its
contents (reproduced on #32391 and #32400, two unrelated backports). They are a
branch condition: 1.13 received the product backports but not the follow-up
test-stabilization commits that landed on main, and one drive-by product fix
that main carried inside an unrelated PR.

Cherry-picked from the corresponding main commits, matching PR #32340 byte for
byte so this does not conflict when that lands:

- TestCaseRepository.updateTestSuite: null/EntityNotFound guard. postDelete on an
  orphan test case reached copyTestSuite(null) -> NPE on TestSuite.getConnection()
  and a 500. Guard came from main's #27997 (bulk/async restore), which is why it
  was never associated with data quality and never backported.
- IngestionPipelineOwnerInheritanceIT: assert ApiException + getStatusCode()==403.
  The 1.13 SDK has no ForbiddenException and no 403 branch, so a 403 arrives as a
  plain ApiException; the jakarta.ws.rs.ForbiddenException introduced to fix the
  #29530 backport build made the assertion unsatisfiable rather than correct.
- UserTestFactory.getOrCreateUser: look up by name, not email, and treat 409 as
  already-created. Required by the WorkflowTriggerPermissionsIT fix below --
  without it getDataConsumer 404s, retries a create that conflicts, and throws.
- WorkflowTriggerPermissionsIT: pin the dataConsumer user in @BeforeAll so
  SubjectCache resolves it and the authorizer returns 403 instead of 404.
- ColumnSearchIndexIT: exact fqnParts term filter under Awaitility instead of a
  generic q= match plus a fixed sleep.
- UserMetricsResourceIT: drop the wall-clock freshness assertions; last_activity
  is a cluster-wide MAX unrelated to this test's own actions.

Verified locally against the mysql-elasticsearch profile (testcontainers MySQL
8.3 + Elasticsearch 9.3): TestCaseDeleteResilienceIT 6/6 pass.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@mohityadav766
mohityadav766 requested a review from a team as a code owner September 2, 2026 08:47
@github-actions

github-actions Bot commented Sep 2, 2026

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.

@mohityadav766 mohityadav766 added safe to test Add this label to run secure Github workflows on PRs backend skip-pr-checks Bypass PR metadata validation check labels Sep 2, 2026
Both are test-only defects that main fixed and 1.13 never received. They are
intermittent, so they did not appear in the #32400 baseline used to scope the
previous commit, and only surfaced on the multi-node lane.

- RdfGlossaryGraphIT.scopedResponseCarriesGlossaryNameAndIdPerNode awaited only
  node presence, then asserted `group` and `glossaryId` outside the Awaitility
  block. The node and its projection land in RDF separately, so on a slower run
  the node is already present while `group` is still null. Move the whole
  assertion inside untilAsserted.
- WorkflowDefinitionResourceIT.test_WorkflowWithTeamCandidates and
  test_WorkflowWithReviewersOwnersCandidates created the table before the
  workflow could consume its creation event, yielding a second approval task
  ("expected: <1> but was: <2>") or no task at all within the 2 minute wait.
  Create the table only after the workflow is deployed.

Taken from PR #32340 byte for byte, as with the previous commit.

Verified locally on the mysql-elasticsearch profile:
WorkflowDefinitionResourceIT 49 tests, 0 failures, 0 errors, 5 skipped.

Note for anyone reproducing RdfGlossaryGraphIT locally: do not pass
-DenableRdf=true. The class starts its own Fuseki container and calls
RdfUpdater.initialize in @BeforeAll, so enabling RDF in TestSuiteBootstrap as
well fails with "RdfRepository already initialized".

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…ss-test delete race

Fixes the last family of failures on the mysql lanes, and most of what is left
on postgres-opensearch. Symptom is one of:

  Api <entityService> instance for <uuid> not found
  Cannot invoke "EntityReference.getFullyQualifiedName()" because
      the return value of "Dashboard.getService()" is null

Single root cause: service-backed entity ITs create a fresh service per entity,
so an unqualified listEntities returns rows belonging to sibling tests. When a
sibling's @AfterEach hard-deletes its service mid-list, server-side hydration of
that row's service ref either throws or yields null.

BaseEntityIT gains a getEntityServiceFqn hook (default null, so non-service
entities are unaffected) and pins every unqualified list call to the entity's own
service. Service-backed subclasses override it. Also bumps the hard-delete
visibility wait from 15s to 45s for the change-event pipeline on the
pg-es-redis parallel lane, and waits for accepted async bulk entities before
asserting on them.

Taken from PR #32340 byte for byte, except for two classes it does not cover:

- PipelineResourceIT: same 7-line override; it hits the identical error and is
  the class that failed on the postgres-opensearch lane.
- DashboardResourceIT: same override, plus test_listDashboardsByService listed
  unscoped with limit=100 and then dereferenced getService() on every returned
  row. It builds its own ListParams, so the base-class hook cannot reach it —
  scoped the call to the service the test created, which is what a test of that
  name was already meant to do. Swept the module for the same shape; this was
  the only other instance (DatabaseSchemaResourceIT already scopes via
  setDatabase).

AuditLogResourceIT and RecognizerFeedbackRepositoryTest are pre-existing
failures on 1.13 unrelated to this branch (both also fail on #32373, the latter
also on #32371); their #32340 fixes are included since they are test-only.

Verified: test-compile and spotless clean across the module.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@@ -974,10 +974,12 @@ protected T getEntityIncludeDeleted(String id) {
@Test

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Quality: Service-scoped list reduces pagination tests to a single row

Each createRequest() creates a fresh parent service (DashboardServiceTestFactory generates a new UUID suffix per call), so scoping the list query to firstEntity's service FQN returns only that one entity. In testAutoPaginationFluentAPI (limit=2) and get_entityListWithPagination_200 the multi-entity/multi-page path is no longer exercised — the lenient assertions (size <= 2, size > 0) pass with a single row, so the stabilization silently guts the coverage these tests were meant to provide. Consider seeding all entities under one shared service (create the service once and reuse its FQN across the 3 creates) so the list is both isolated and actually contains multiple rows.

Was this helpful? React with 👍 / 👎

The openmetadata-service unit lane is red on every 1.13 PR, not just this one:
8 failures on #32400, #32371 and #32373. This branch already showed 6 — a strict
subset, the other 2 (AuthenticationCodeFlowHandlerTest) having been fixed by
#32408 landing on the base. Nothing here was caused by this branch; these are
the remaining 6.

Three assert against entities and fields that only exist on main/2.0, having been
backported wholesale:

- IndexMappingNestedFieldConsistencyTest asserted mappings for auditReport,
  aiApplication, llmModel and aiGovernance. None of those entities exist on 1.13.
- SearchIndexFactoryTest asserted page reindex fields include "parent"; page
  hierarchy is main-only.
- SearchRepositoryBehaviorTest expected the column child index to be aliased
  cluster_column_search_index; on 1.13 it is cluster_tableColumn.

EntityCsvTest covers domain/data-product validation on bulk edit.

SearchRepositoryBehaviorTest also gains a test for an EXTERNAL_HANDLER-only
change emitting no child-update call, which needs the accompanying
SearchRepository fix: appendUpdate/appendDelete/appendCreate appended a
separator unconditionally, so a propagation whose switch branch deliberately
emits nothing (certification, driven by propagateCertificationTags) produced a
whitespace-only script that still fired updateChildren against every child
index. The three guards only append the separator when the branch actually
wrote something.

That makes two product changes on this branch: the TestCaseRepository
null/EntityNotFound guard and these three separator guards. Everything else is
test-only.

Verified locally: EntityCsvTest 63, SearchIndexFactoryTest 200,
SearchRepositoryBehaviorTest 115, IndexMappingNestedFieldConsistencyTest 4 —
382 tests, 0 failures, 0 errors. Spotless clean.

Taken from PR #32340 byte for byte.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@gitar-bot

gitar-bot Bot commented Sep 2, 2026

Copy link
Copy Markdown
Code Review 👍 Approved with suggestions 1 resolved / 2 findings

Clears nine pre-existing Java IT failures blocking 1.13 backports by backporting test-stabilization fixes from main: guards against orphaned test case NPE, fixes ForbiddenException assertion and subject cache misses, deflakes search index multi-match and user metrics wall-clock bound issues, and adds UserTestFactory for email-based lookup. All 39 critical tests now pass locally. Consider seeding paginated list test entities under a single shared service to restore multi-page coverage that the service-scoped isolation currently bypasses with single-row results.

💡 Quality: Service-scoped list reduces pagination tests to a single row

📄 openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/BaseEntityIT.java:974-988 📄 openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/BaseEntityIT.java:3387-3401

Each createRequest() creates a fresh parent service (DashboardServiceTestFactory generates a new UUID suffix per call), so scoping the list query to firstEntity's service FQN returns only that one entity. In testAutoPaginationFluentAPI (limit=2) and get_entityListWithPagination_200 the multi-entity/multi-page path is no longer exercised — the lenient assertions (size <= 2, size > 0) pass with a single row, so the stabilization silently guts the coverage these tests were meant to provide. Consider seeding all entities under one shared service (create the service once and reuse its FQN across the 3 creates) so the list is both isolated and actually contains multiple rows.

✅ 1 resolved
✅ Edge Case: getOrCreateUser 409 retry can rethrow on name/email mismatch

📄 openmetadata-integration-tests/src/test/java/org/openmetadata/it/factories/UserTestFactory.java:49-63
In UserTestFactory.getOrCreateUser, after a create fails with 409 CONFLICT the code re-fetches with Users.findByName(name). If the conflict was triggered by an existing user with the same email but a different name (name is derived from email.split("@")[0], so this is only a theoretical divergence), the findByName(name) lookup will 404 and throw an uncaught OpenMetadataException. This is a narrow edge in test-only code; consider catching the re-fetch failure and surfacing a clearer message, or looking up by email on the conflict path.

🤖 Prompt for agents
Code Review: Clears nine pre-existing Java IT failures blocking `1.13` backports by backporting test-stabilization fixes from `main`: guards against orphaned test case NPE, fixes `ForbiddenException` assertion and subject cache misses, deflakes search index multi-match and user metrics wall-clock bound issues, and adds `UserTestFactory` for email-based lookup. All 39 critical tests now pass locally. Consider seeding paginated list test entities under a single shared service to restore multi-page coverage that the service-scoped isolation currently bypasses with single-row results.

1. 💡 Quality: Service-scoped list reduces pagination tests to a single row
   Files: openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/BaseEntityIT.java:974-988, openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/BaseEntityIT.java:3387-3401

   Each createRequest() creates a fresh parent service (DashboardServiceTestFactory generates a new UUID suffix per call), so scoping the list query to firstEntity's service FQN returns only that one entity. In testAutoPaginationFluentAPI (limit=2) and get_entityListWithPagination_200 the multi-entity/multi-page path is no longer exercised — the lenient assertions (size <= 2, size > 0) pass with a single row, so the stabilization silently guts the coverage these tests were meant to provide. Consider seeding all entities under one shared service (create the service once and reuse its FQN across the 3 creates) so the list is both isolated and actually contains multiple rows.

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

This branch was previously deployed

1 inactive deployment
test — a4b836f1 Deployed Sep 2, 2026 by mohityadav766 via playwright-ci-postgresql (6, 6) #78196
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 skip-pr-checks Bypass PR metadata validation check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant