Skip to content

fix(ingestion): pin anyio<4.15 in the mlflow test image to unblock py-tests shard-2 - #32525

Merged
pmbrull merged 2 commits into
mainfrom
fix/mlflow-fixture-anyio-pin
Sep 3, 2026
Merged

pmbrull merged 2 commits into
mainfrom
fix/mlflow-fixture-anyio-pin

Conversation

@manerow

@manerow manerow commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes #32528

tests/integration/sources/mlmodels/mlflow/test_mlflow.py::test_mlflow has been erroring during fixture setup on every branch since 2026-09-02 21:59 UTC, failing python / Integration Tests (shard-2) on all three Python versions and ejecting PRs from the merge queue.

ERROR tests/integration/sources/mlmodels/mlflow/test_mlflow.py::test_mlflow
RuntimeError: MLflow server did not become ready in time.
  ingestion/tests/integration/sources/mlmodels/mlflow/conftest.py:136

Not a code regression. No commit landed on main between the last green run and the first red one.

Last green shard-2 2026-09-02T21:08:14Z
anyio 4.15.0 published to PyPI 2026-09-02T21:46:35Z
First red shard-2 2026-09-02T21:59:31Z
main unchanged across that window f1ed7b42 (14:47Z) → 83c7612b (2026-09-03 04:16Z)

Since then: 48 failed py-tests runs across 23 branches, 10 PRs ejected from the merge queue (#31848, #31990, #32014, #32074, #32181, #32306, #32342, #32375, #32427, #32492), plus 1.13 and 2.0 backport branches.

Type of change:

  • Bug fix

High-level design:

Root cause. The fixture builds a throwaway MLflow server image with an unlocked install, so transitive dependencies float:

RUN pip install cryptography "mlflow>=3.10.0,<3.11" boto3 pymysql

anyio 4.15.0 changed anyio and anyio.abc to import their submodules lazily (agronholm/anyio#1169), and from_thread is not exposed by that mechanism. Starlette's WSGIMiddleware calls anyio.from_thread.run(...) without importing the submodule, and MLflow serves its tracking API through that adapter, so every request returns 500:

File ".../starlette/middleware/wsgi.py", line 136, in start_response
    anyio.from_thread.run(
File ".../anyio/_lazyimport.py", line 41, in __getattr__
    raise AttributeError(
AttributeError: module 'anyio' has no attribute 'from_thread'

/health never returns 200, so the readiness loop gives up.

Second commit. The same loop's time.sleep(2) sat inside the except block, so a response that arrives but is not 200 never slept: all 30 attempts burned in milliseconds instead of the intended 60s. This is not what made the test fail, but it is why the fixture reported "did not become ready" almost instantly and why a server that 500s during warm-up is indistinguishable from one that is down. Moving the sleep out restores the intended budget. Drop this commit if you would rather keep the change to one line.

Nothing shipped is affected. The MLflow connector depends on mlflow-skinny (ingestion/setup.py:370), which ships no server and never reaches WSGIMiddleware. The CI ingestion venv itself installed anyio-4.15.0 and the other 146 tests in the same shard passed. This Dockerfile is built inside the test, never published and never scanned.

No security regression. anyio has no published GitHub security advisories, and 4.15.0 is a feature release with no security fix, so the bound reintroduces nothing. The mlflow>=3.10.0 floor that #28231 set to clear Snyk high/critical findings is untouched.

Rejected alternatives.

  • Bump MLflow past the <3.11 cap. Does not constrain anyio. Verified: MLflow 3.14.0 also resolves starlette 1.6.0 + anyio 4.15.0 and hits the same path; opendatahub-io/agentic-ci#382 reports the same for 3.15.2.
  • Relax the readiness probe. It would hide a server returning 500 for every request.
  • Pin anyio anywhere outside this image. The ingestion runtime is unaffected and should keep floating.

The bound can be removed once anyio restores the attribute or starlette imports the submodule; that condition is in the code comment.

Tests:

Use cases covered

  • The MLflow fixture builds an image whose server answers /health with 200.
  • The MLflow tracking API, which the connector actually calls, answers through the WSGI adapter rather than 500ing.

Unit tests

Not applicable: test-fixture-only change.

Backend integration tests

Not applicable: no server changes.

Ingestion integration tests

ruff check and ruff format --check (pinned ruff~=0.15.12) pass on the changed file.

End-to-end, driving the Dockerfile bytes extracted from this branch's conftest.py and starting the same three containers with the fixture's own commands (mysql:8.4.5 with --log-bin-trust-function-creators=1, minio/minio:RELEASE.2022-12-02T19-19-22Z, the built MLflow image):

resolved: anyio 4.14.2  mlflow 3.10.1  starlette 1.6.0
READY after 8s
GET /health                                    -> 200
GET /api/2.0/mlflow/experiments/search         -> 200

A/B control on the same setup, changing only the anyio bound:

anyio GET /health
4.15.0 (before this PR) 500, AttributeError: module 'anyio' has no attribute 'from_thread'
4.14.2 (after this PR) 200

Playwright (UI) tests

Not applicable.

UI screen recording / screenshots:

Not applicable.

Checklist:

  • I have read the CONTRIBUTING document.
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: not applicable, no schema change.
  • I have added a test that covers the exact scenario we are fixing: the existing test_mlflow is that test; this PR restores it.

Backports needed: 1.13 and 2.0 carry the same unpinned line and are failing the same way.

@manerow
manerow requested a review from a team as a code owner September 3, 2026 07:23
@github-actions

github-actions Bot commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR checks passed

The linked issue has a description and all required Shipping project fields set. Thanks!

@github-actions github-actions Bot added backend safe to test Add this label to run secure Github workflows on PRs labels Sep 3, 2026
@manerow
manerow force-pushed the fix/mlflow-fixture-anyio-pin branch from 52ced6e to aab2022 Compare September 3, 2026 07:27
@gitar-bot

gitar-bot Bot commented Sep 3, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Pins anyio<4.15 in the MLflow test fixture image to unblock the failing test_mlflow fixture setup. anyio 4.15.0 changed lazy-loading behavior that breaks Starlette's WSGIMiddleware when called from MLflow's tracking API, causing the server readiness probe to fail. The second commit improves the readiness loop to wait properly between probe attempts. 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 👍 / 👎 | Powered by Gitar — free for open source

@manerow manerow added the To release Will cherry-pick this PR into the release branch label Sep 3, 2026
@IceS2
IceS2 enabled auto-merge September 3, 2026 08:12
@sonarqubecloud

sonarqubecloud Bot commented Sep 3, 2026

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

🔴 Playwright Results — workflow failed

Validated commit aab2022663183cac74fba24a165f611828ad3e29 in Playwright run 33728210460, attempt 1.

✅ 108 passed · ❌ 1 failed · 🟡 1 flaky · ⏭️ 0 skipped · 🧰 0 lifecycle flaky

❌ Action needed: test(s) failed on every attempt against this PR’s validated commit — see Genuine Failures below. These are test failures, not CI budget or infrastructure issues.

Performance

Blocking targets: ✅ met · Optimization targets: 🟡 in progress

Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting.

🕒 Full workflow signal wall (to summary) 58m 29s

⏱️ Max setup 5m 47s · max shard execution 18m 24s · max shard-job elapsed before upload 24m 41s · reporting 5s

🌐 220.03 requests/attempt · 1.79 app boots/UI scenario · 0.00% common-shard skew

Optimization targets still in progress:

  • Browser traffic was 220.03 requests per attempt (convergence target: fewer than 200).
  • Application boot ratio was 1.79 per UI scenario (220 boots / 123 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
✅ Shard chromium-01 46 0 0 0 0 0
✅ Shard ingestion-01 30 0 0 0 0 0
🔴 Shard ingestion-02 32 1 1 0 0 0

Genuine Failures (failed on all attempts)

❌ Pages/TestSuiteDetailsPage.spec.ts › Add test case modal on Test Suite details page - filters and select (shard ingestion-02)
Error: �[2mexpect(�[22m�[31mlocator�[39m�[2m).�[22mtoHaveCount�[2m(�[22m�[32mexpected�[39m�[2m)�[22m failed  Locator:  getByTestId('test-case-table').locator('[role="rowgroup"]').last().getByRole('row') Expected: �[32m1�[39m Received: �[31m0�[39m Timeout:  30000ms  Call log: �[2m  - Expect "toHaveCount" with timeout 30000ms�[22m �[2m  - waiting for getByTestId('test-case-table').locator('[role="rowgroup"]').last().getByRole('row')�[22m �[2m    33 × locator resolved to 0 elements�[22m �[2m       - unexpected value "0"�[22m 
🟡 1 flaky test(s) (passed on retry)
  • Features/DataQuality/DataQuality.spec.ts › Pagination functionality in test cases list (shard ingestion-02, 1 retry)

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

@pmbrull
pmbrull disabled auto-merge September 3, 2026 08:49
@pmbrull
pmbrull merged commit b132774 into main Sep 3, 2026
168 of 172 checks passed
@pmbrull
pmbrull deleted the fix/mlflow-fixture-anyio-pin branch September 3, 2026 08:49
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Failed to cherry-pick changes to the 1.13 branch.
Please cherry-pick the changes manually.
You can find more details here.

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Failed to cherry-pick changes to the 2.0 branch.
Please cherry-pick the changes manually.
You can find more details here.

harshsoni2024 pushed a commit that referenced this pull request Sep 3, 2026
manerow added a commit that referenced this pull request Sep 3, 2026
shrabantipaul-collate pushed a commit to PRADDZY/OpenMetadata that referenced this pull request Sep 3, 2026
…-tests shard-2 (open-metadata#32525)

* fix(ingestion): pin anyio<4.15 in the mlflow test image

* fix(ingestion): wait between mlflow readiness probes on a non-200 response

This branch was previously deployed

1 inactive deployment
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 To release Will cherry-pick this PR into the release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MLflow ingestion integration test fails on every branch after anyio 4.15.0, blocking the merge queue

4 participants