Skip to content

Fix the integration tests failing on 2.1 and the service-connection wipe (backport 2.1 #37725) - #37850

Merged
yan-3005 merged 2 commits into
2.1from
backport/2.1/pr-37725
Nov 16, 2026
Merged

yan-3005 merged 2 commits into
2.1from
backport/2.1/pr-37725

Conversation

@yan-3005

@yan-3005 yan-3005 commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Backport of #37725 to 2.1, plus a fix for the one test #37725 left failing. No issue: this is a test fix, carrying one production fix.

Every PR that broke these tests on main is already on 2.1 (#37054, #36952, #36695, #36077, #36764, #37051, #36043, #37450, #37617, #37489, #32920), so 2.1 has the same failures and needs the same fixes.

#37725 (cherry-picked with -x)

DataProductDeleteRaceIT probe fix (new commit; main needs it too)

  • On CI MySQL the lock probe read statement text from information_schema.innodb_trx and never matched the blocked statements.
  • The probe now reads performance_schema.data_lock_waits joined to data_locks. That names the table each blocked transaction waits on and does not depend on statement text.
  • Postgres keeps its pg_stat_activity probe.

Not included: CredentialDatabaseOutageIT fails on main because of #37704 (McpAvailabilityFilter reads the database before the 503 path). #37704 is not on 2.1.

Type of change:

  • Bug fix

High-level design:

Not applicable — a backport plus one test-probe change.

Tests:

Backend integration tests

Run on this branch (2.1 + the backport) with mvn -B verify -pl :openmetadata-integration-tests -am -P<engine> -DintegrationTests.lane=<lane> -Dit.test=…:

Engine Lane Classes / methods Result
MySQL+ES global-state DataProductDeleteRaceIT, MetricMigrationIT, NativeOntologyEveryPackInstallIT (-Dontology.packs.only=foaf) Tests run: 9, Failures: 0. Race tests take 1.7s, 1.8s and 3.8s, not about 50s
MySQL+ES parallel OntologyBulkIT, IncidentGroupsIT, DomainReassignmentAuthorizationIT, DomainMoveApprovalAuthorizationIT, OntologyDraftQueryIT, AIContextMcpIT, DatabaseServiceResourceIT, SecretsManagerNullSecretIT + the fixed TaskResourceIT, TeamResourceIT, DataContractResourceIT methods Tests run: 380, Failures: 0, Errors: 0
PG+OS global-state same as MySQL Tests run: 9, Failures: 0. Race tests take 0.8s, 2.0s and 3.0s
PG+OS parallel same as MySQL Tests run: 380, Failures: 0, Errors: 0

All 16 methods #37725 fixed or added are confirmed passing in the reports.

Not run locally: PG+ES+Redis, and all 16 ontology packs. #37725's full CI runs on main passed every lane except the global-state lane fixed here.

Unit tests / Ingestion / Playwright

Not applicable: no unit-tested logic, ingestion or UI changes beyond #37725.

Checklist:

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; no actionable issues were found.

Summary

This backport preserves stored service connections when a PUT omits connection and keeps the approval gate from staging that omission as a deletion.

  • A service PUT keeps its connection when the request leaves it out.
  • The race test finds MySQL lock waits and runs outside the parallel lane.
  • ODCS export tests check native rules that the format cannot express.
  • Domain authorization tests use bounded patches for domain changes.
  • Incident migration tests link each status record to its test case.
  • Metric response tests leave hidden child metrics out of the results.
  • Team import tests give the importing owner access to each team.
  • Task tests check the current error for field paths that name no field.
  • Bulk ontology tests give each glossary a distinct name.
  • The draft-query test activates an ontology before checking its query.

No actionable issues were found. This review used source inspection; no tests were run.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Service PUT omits connection] --> B{Held for approval?}
  B -->|Yes| C[Do not stage a connection change]
  B -->|No| D[Copy the stored connection]
  D --> E[Store through existing secret protection]
  C --> F[Review only the requested changes]
Loading

Reviews (1) · Last reviewed commit: "test(it): read MySQL lock waits from per..." · Reviewed by Greptile

yan-3005 and others added 2 commits November 16, 2026 12:19
…e 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)
…tDeleteRaceIT

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.
@yan-3005
yan-3005 requested a review from a team as a code owner November 16, 2026 07:12
@yan-3005
yan-3005 requested review from manerow and removed request for a team November 16, 2026 07:12
@yan-3005 yan-3005 added the skip-pr-checks Bypass PR metadata validation check label Nov 16, 2026
@gitar-bot

gitar-bot Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Code Review ✅ Approved 🔴 High risk

Preserving omitted service connections on PUT could keep services using stale credentials when clients expect omission to clear them; clearing now requires PATCH.

Backports the integration test fixes from #37725 to 2.1, updating 13 stale tests and fixing the service-connection wipe so a PUT that omits connection keeps the stored one. Also switches the DataProductDeleteRaceIT lock probe to performance_schema.data_lock_waits and moves two classes to the global-state lane. No issues found.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

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

@yan-3005
yan-3005 merged commit 6ee127f into 2.1 Nov 16, 2026
57 of 58 checks passed
@yan-3005
yan-3005 deleted the backport/2.1/pr-37725 branch November 16, 2026 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-pr-checks Bypass PR metadata validation check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants