Repository navigation
Fix every integration-test failure on main: 14 stale/broken tests, the service-connection wipe, the parallel-lane timeout - #37725
Conversation
…ed ITs Each test was broken by a later PR whose behaviour change is intended and recorded, but merged without the integration lanes running: - IncidentGroupsIT x3, MetricMigrationIT: the 2.1.0 incident backfill now requires a testCase parentOf row (#37054); seed it like the write path does. - TeamResourceIT x2: only admins add team roles (ADR 2026-10-30) and every CSV row needs EDIT_ALL on its own team (ADR 2026-11-02). - DomainMoveApprovalAuthorizationIT, DomainReassignmentAuthorizationIT: a JSON Patch on the document root is refused with 400 (ADR 2026-11-03). - AIContextMcpIT: a metric child the caller cannot view is dropped (ADR 2026-10-31); amend the 2026-10-29 record that said otherwise. - OntologyDraftQueryIT: the release scope needs an active release first. - TaskResourceIT: field paths end in tags/description (#37051). - OntologyBulkIT: the two glossaries of one test shared a name. - DataContractResourceIT x2: unknown imported fields are carried as source metadata, and an imported numeric-unsafe rule is stored as an embedded custom rule (ADR 2026-11-09).
Tighten the DataContract export assertion to the exporter's message, drop the TeamResourceIT Javadoc clause the removed step proved, and note in the metric ADR amendment that the VIEW_ALL expression filter has no caller in the suite that can reach it.
❌ 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 |
…IT lanes - ServiceEntityRepository: a PUT without `connection` now keeps the stored connection, as #32920 and issue #29494 intend and DatabaseServiceResourceIT.put_updateWithoutConnection_preservesExistingConnection_200 asserts. Each generated service types its own setter, so the stored connection is copied in place through its JSON form. Stored ciphertext and vault references pass through storage unchanged (ADR 2026-10-29 service-connection-secrets-are-written-only-during-storage). - NativeOntologyEveryPackInstallIT moves to the global-state lane. Its @isolated 11-15 minute install of every pack pushed the parallel lane past its 65 minute budget; the global-state lane runs beside it with headroom and every pack still installs on each merge (ADR 2026-11-06). - DataProductDeleteRaceIT matches lock waiters by table on MySQL too: a run waited the full minute on a blocked statement that did not carry the data product's id.
The approval gate staged a PUT that omits `connection` as `connection: null`, so approving it would still delete the credentials. Services now declare `connection` and `serviceAttributes` as fields a PUT keeps, matching the updater. Records the decision and its security reasoning in ADR 2026-11-13-a-put-that-omits-a-service-connection-keeps-the-stored-one. SecretsManagerNullSecretIT covers both paths against the in-memory vault: a direct PUT keeps the connection and its vault secrets, and a held PUT stages no connection op (fails without the override). DataProductDeleteRaceIT moves to the serial global-state lane and matches whole table names, so no other test's lock wait can stand in for its own.
…ested A red run of the old updater shows the service row losing its connection while the vault entries were still present right after the PUT, so the record no longer claims the vault entries were deleted.
Code Review ✅ Approved 🔴 High riskChanging service PUTs to retain omitted connections could leave credentials active for integrations that previously relied on omission to remove them. Fixes 14 deterministically failing integration tests on main by updating them to match recorded behaviour changes, and fixes a production bug where a PUT omitting VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|
Full integration-test runs dispatched on this branch (
Results will be posted here when they finish. |
|
🤖 Backport to |
|
🤖 Not backported to
|
…ipe (backport 2.1 #37725) (#37850) * Fix every integration-test failure on main: 14 stale/broken tests, the service-connection wipe, the parallel-lane timeout (#37725) * test(it): fix 13 integration tests main has failed since merges skipped ITs Each test was broken by a later PR whose behaviour change is intended and recorded, but merged without the integration lanes running: - IncidentGroupsIT x3, MetricMigrationIT: the 2.1.0 incident backfill now requires a testCase parentOf row (#37054); seed it like the write path does. - TeamResourceIT x2: only admins add team roles (ADR 2026-10-30) and every CSV row needs EDIT_ALL on its own team (ADR 2026-11-02). - DomainMoveApprovalAuthorizationIT, DomainReassignmentAuthorizationIT: a JSON Patch on the document root is refused with 400 (ADR 2026-11-03). - AIContextMcpIT: a metric child the caller cannot view is dropped (ADR 2026-10-31); amend the 2026-10-29 record that said otherwise. - OntologyDraftQueryIT: the release scope needs an active release first. - TaskResourceIT: field paths end in tags/description (#37051). - OntologyBulkIT: the two glossaries of one test shared a name. - DataContractResourceIT x2: unknown imported fields are carried as source metadata, and an imported numeric-unsafe rule is stored as an embedded custom rule (ADR 2026-11-09). * test(it): address self-review on the main IT fixes Tighten the DataContract export assertion to the exporter's message, drop the TeamResourceIT Javadoc clause the removed step proved, and note in the metric ADR amendment that the VIEW_ALL expression filter has no caller in the suite that can reach it. * fix: keep a service's connection on a PUT that omits it; unblock the IT lanes - ServiceEntityRepository: a PUT without `connection` now keeps the stored connection, as #32920 and issue #29494 intend and DatabaseServiceResourceIT.put_updateWithoutConnection_preservesExistingConnection_200 asserts. Each generated service types its own setter, so the stored connection is copied in place through its JSON form. Stored ciphertext and vault references pass through storage unchanged (ADR 2026-10-29 service-connection-secrets-are-written-only-during-storage). - NativeOntologyEveryPackInstallIT moves to the global-state lane. Its @isolated 11-15 minute install of every pack pushed the parallel lane past its 65 minute budget; the global-state lane runs beside it with headroom and every pack still installs on each merge (ADR 2026-11-06). - DataProductDeleteRaceIT matches lock waiters by table on MySQL too: a run waited the full minute on a blocked statement that did not carry the data product's id. * fix: an approval-held PUT without a connection must not clear it either The approval gate staged a PUT that omits `connection` as `connection: null`, so approving it would still delete the credentials. Services now declare `connection` and `serviceAttributes` as fields a PUT keeps, matching the updater. Records the decision and its security reasoning in ADR 2026-11-13-a-put-that-omits-a-service-connection-keeps-the-stored-one. SecretsManagerNullSecretIT covers both paths against the in-memory vault: a direct PUT keeps the connection and its vault secrets, and a held PUT stages no connection op (fails without the override). DataProductDeleteRaceIT moves to the serial global-state lane and matches whole table names, so no other test's lock wait can stand in for its own. * docs(adr): state what an omitted connection lost before the fix, as tested A red run of the old updater shows the service row losing its connection while the vault entries were still present right after the PUT, so the record no longer claims the vault entries were deleted. (cherry picked from commit a634c55) * test(it): read MySQL lock waits from performance_schema in DataProductDeleteRaceIT On CI the innodb_trx statement text never matched the blocked statements, so each race step only ended when a request hit MySQL's 50s lock-wait timeout, and one step outlived the 60s wait. data_lock_waits joined to data_locks names the table each blocked transaction waits on, independent of the statement text. Locally the three races now take 1.7-3.8s on MySQL instead of about 50s.
Describe your changes:
Fixes every integration-test failure on
main: the 14 tests that fail deterministically in every engine (MySQL+ES, PG+ES+Redis, PG+OS), the parallel lane that times out at its 65m budget, and theDataProductDeleteRaceITflake. No issue: this is a test fix.The last green IT run on
mainwas on Nov 3. Since then PRs merged without the integration lanes running (PR CI skips ITs, and no merge-queue IT run is recorded after Nov 3). For each failure I read the breaking PR's description and decision record: 13 tests were broken by an intended, recorded behaviour change and are updated; one (DatabaseServiceResourceIT) caught a production bug that contradicts its own PR's stated intent, so the code is fixed.IncidentGroupsIT×3 (testMixedCaseAssigneeNameResolvesToItsUser,testDuplicateMaxTimestampTieBreak,testAssigneeDenseGroupIsNotTruncated)test_case_incidentbackfill skips incidents without atestCase → testCaseResolutionStatusparentOf rowMetricMigrationIT.mergedMigrationUpgradesPopulatedPriorShapeFixtureTeamResourceIT.test_impersonatedOwner_cannotChangeDefaultRolesOrPoliciestest_ownerCannotAddRolesOrPoliciesToOwnTeam)TeamResourceIT.test_importCsv_ownerDryRunReimportsNestedHierarchyDomainMoveApprovalAuthorizationIT.aMoveIntoAnUnheldDomainIsRefusedNotHeld/domainspatch, which still reaches the domain check before the approval holdDomainReassignmentAuthorizationIT.test_wholeDocumentPatchCannotMoveAnAssetIntoAnUnheldDomainmcp.AIContextMcpIT.getEntityDetails_withholdsExpressionOfAVariantTheCallerCannotViewOntologyDraftQueryIT.aViewerIsRefusedAServiceClauseHiddenInsideAnExpressionTaskResourceIT.testTagTaskFieldMustBeATaggedFieldOfItsEntitytags/description; new error textcolumns.no_such_column.tags, assertnames no fieldOntologyBulkIT.listJobsIsGlossaryScopedDataContractResourceIT.testRepairedSqlAssertionsAndDottedColumnsSurviveStoredVersionedExportscustom/odcsrule and exported wholeDataContractResourceIT.testIncompatiblePreservedMetadataBlocksAllExportRoutesWithoutLosingIt→ renamedtestIncompatibleStoredRuleBlocksAllExportRoutesWithoutLosingItODCSExportServiceTestdoes) and assert the rule is keptProduction fix and lane/flake fixes:
DatabaseServiceResourceIT.put_updateWithoutConnection_preservesExistingConnection_200(never passed onmain)ServiceEntityRepository.updateConnectionskipped a null incoming connection and the update stored the service with none — a PUT withoutconnectionsilently removed it. #32920's guard and test are right; the updater was the missing halfupdateConnection: a PUT that omitsconnectionkeeps the stored one, asserviceAttributesalready does; PATCH still clears it on purpose.getFieldsKeptByPutnow listsconnectionandserviceAttributes, so a PUT held by an approval workflow does not stageconnection: nulleither (approving it would otherwise clear the connection). Each generated service types its ownsetConnection, so the stored connection is copied onto the update in place through its JSON form (JsonUtils.overwriteFromTokenBuffer, already used bySecretMapOwnership). The stored value is ciphertext or vault references, which storage keeps unchanged (ADR:2026-10-29-service-connection-secrets-are-written-only-during-storage)timeoutfired@IsolatedNativeOntologyEveryPackInstallIT(647s MySQL / 913s PG, nothing else runs beside it)ContextMemoryExtractionRequestIT). That lane runs in its own job beside the parallel one (~25m today), and every pack still installs on each merge, as ADR:2026-11-06-ontology-library-packs-are-verbatim-pinned-upstream-releases requiresDataProductDeleteRaceIT.addDuringDomainCascadeWritesNoEdgeForTheDeletedDataProduct(MySQL flake)DELETEtook 60,355 ms and returned the moment the test released its row lock: it was blocked all along, but the MySQL probe matched waiting statements on the data product's id and the blocked statement did not carry itWhy keeping an omitted connection is the secure behaviour (recorded in ADR:2026-11-13-a-put-that-omits-a-service-connection-keeps-the-stored-one):
storeServiceConnection: false+forceEntityOverwriting: true, and SDK upserts by name do too (NPE in ServiceEntityResource.unmask when PUT service request has no connection field #29494).EDIT_ALL. Readers without it getconnection: null, which means "not visible", never "cleared" (ADR:2026-10-26-service-connection-visibility-follows-edit-permission). Clearing takes an explicit PATCH, per the review bar's "a PUT that omits a field keeps the stored value".decryptOrNullify.2.1(2.1.0-rc2), so this fix needs the 2.1 backport too.Type of change:
High-level design:
Not applicable — test updates, one guarded production fix in
ServiceEntityRepository.updateConnection, and an IT lane move; no new design.Tests:
Use cases covered
Each fixed test now asserts the behaviour its breaking PR recorded (see the table above).
Unit tests
ServiceEntitySecretsTest(guard of the 2026-10-29 secrets ADR): Tests run: 18, Failures: 0. The connection fix's regression test is the existing ITDatabaseServiceResourceIT.put_updateWithoutConnection_preservesExistingConnection_200, which fails without it.Backend integration tests
Run by hand (each class's lane and engine;
mvn -B verify -pl :openmetadata-integration-tests -am -P<engine> -DintegrationTests.lane=<lane> -Dit.test=…):OntologyBulkIT,IncidentGroupsIT,DomainReassignmentAuthorizationIT,DomainMoveApprovalAuthorizationIT,OntologyDraftQueryIT,AIContextMcpIT(whole classes) + theTaskResourceIT,TeamResourceIT,DataContractResourceITmethods aboveMetricMigrationITMetricMigrationITDataContractResourceIT#testIncompatibleStoredRuleBlocksAllExportRoutesWithoutLosingItafter the review fixDatabaseServiceResourceIT,PipelineServiceResourceIT,MessagingServiceResourceIT,SecretsManagerNullSecretIT(whole classes)DataProductDeleteRaceITNativeOntologyEveryPackInstallIT(-Dontology.packs.only=foaf, lane selection check)DatabaseServiceResourceIT,SecretsManagerNullSecretIT,DataProductDeleteRaceITNativeOntologyEveryPackInstallIT(-Dontology.packs.only=foaf)SecretsManagerNullSecretIT(incl. 2 new:aPutWithoutAConnectionKeepsTheStoredConnectionAndItsSecrets,aHeldPutWithoutAConnectionStagesNoConnectionChange),DatabaseServiceResourceITDataProductDeleteRaceIT,NativeOntologyEveryPackInstallIT(foaf) after the lane moveaHeldPutWithoutAConnectionStagesNoConnectionChangewith thegetFieldsKeptByPutoverride removed[connection, description]put_updateWithoutConnection_preservesExistingConnection_200+aPutWithoutAConnectionKeepsTheStoredConnectionAndItsSecretswith theupdateConnectionkeep removednull(read as admin, who gets the masked connection, so not the visibility null); vault entries still present right after the PUTNot run locally: PG+ES+Redis (same SQL and code paths as PG+OS for these tests); the merge queue runs all engines. The merge queue is the first full run of every lane, including all 16 packs in the global-state lane.
Ingestion integration tests
Playwright (UI) tests
Manual testing performed
Not applicable — test-only change; evidence is the IT runs above.
UI screen recording:
Not applicable — test-only change.
Checklist:
Fixes <issue-number>: <short explanation>— test fix, descriptive title,skip-pr-checks.Fixes #<issue-number>above. — test fix, no issue.REVIEW.md(thepr-checklistskill runs it) and fixed every 🔴 finding, or answered it on the line below.35a4b2b199; fixed the 🟡s (stale Javadoc inTeamResourceIT, tighterCannot export ODCSassertion, comment wording) in 7ee0a13.bfea80cc63(connection fix, lane moves): 🔴 an approval-held PUT still stagedconnection: null→ fixed inf2a0c34818(getFieldsKeptByPut+ RED/GREEN IT); 🟡 DeleteRace table matching could count other classes' lock waits → moved to the serial global-state lane with whole-name matching; 🟡 external-secrets coverage for the kept connection →SecretsManagerNullSecretIT#aPutWithoutAConnectionKeepsTheStoredConnectionAndItsSecrets.AIContextMcpITno longer guardsMetricVariants'VIEW_ALLexpression filter." True — the relation-visibility filter now drops such a child first. A caller withVIEW_BASICbut notVIEW_ALLcannot be built in this suite: every user holds the Organization's defaultDataConsumerrole, and a deny ofVIEW_ALLalso deniesVIEW_BASIC. Changing the Organization default is global state the parallel lane shares. Recorded in the ADR amendment.mustBeon a storedcustom/odcswrapper rule may export without the edit (the wrapper is embedded whole).🤖 Generated with Claude Code