Skip to content

Fix The PreCommit Python ML tests with ML deps installed job#39007

Open
aIbrahiim wants to merge 1 commit into
apache:masterfrom
aIbrahiim:fix/beam_PreCommit_Python_ML-milvus
Open

Fix The PreCommit Python ML tests with ML deps installed job#39007
aIbrahiim wants to merge 1 commit into
apache:masterfrom
aIbrahiim:fix/beam_PreCommit_Python_ML-milvus

Conversation

@aIbrahiim

@aIbrahiim aIbrahiim commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Fixes: #31285
Successful run: https://github.com/apache/beam/actions/runs/27721340857/job/82007252131?pr=39007

Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Mention the appropriate issue in your description (for example: addresses #123), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment fixes #<ISSUE NUMBER> instead.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests
Go tests

See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.

@aIbrahiim aIbrahiim marked this pull request as ready for review June 17, 2026 21:57
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses stability and configuration issues within the Milvus integration tests. By disabling parallel execution (xdist) for specific tests, refining container startup commands, and tuning connection retry parameters, the changes ensure more reliable test outcomes in the CI environment.

Highlights

  • Test Stability: Disabled xdist for Milvus integration tests to prevent concurrency issues during test execution.
  • Container Configuration: Explicitly set the startup command for the Milvus container to ensure proper initialization.
  • Connection Retries: Adjusted the retry logic for Milvus client connections to improve efficiency during startup.
New Features

🧠 You can now enable Memory (public preview) to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request configures Milvus integration tests to run without xdist parallelization, explicitly sets the container command, and reduces the connection retry limits. The review feedback warns that reducing the connection retries to 5 with a flat delay of 2.0 seconds may cause flaky test failures in resource-constrained CI environments and suggests increasing the retries and retaining a backoff factor.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread sdks/python/apache_beam/ml/rag/test_utils.py Outdated
@aIbrahiim aIbrahiim force-pushed the fix/beam_PreCommit_Python_ML-milvus branch from f3ec9d5 to 64d0c6d Compare June 17, 2026 22:47
@aIbrahiim aIbrahiim changed the title Fix Milvus ML PreCommit xdist, container startup, and grpc readiness Fix The PreCommit Python ML tests with ML deps installed job Jun 17, 2026
@codecov

codecov Bot commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 60.25%. Comparing base (6ed0635) to head (64d0c6d).
⚠️ Report is 26 commits behind head on master.

Files with missing lines Patch % Lines
sdks/python/apache_beam/ml/rag/test_utils.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             master   #39007   +/-   ##
=========================================
  Coverage     60.25%   60.25%           
  Complexity    20572    20572           
=========================================
  Files          3318     3318           
  Lines        315452   315485   +33     
  Branches      17142    17142           
=========================================
+ Hits         190073   190104   +31     
- Misses       116830   116832    +2     
  Partials       8549     8549           
Flag Coverage Δ
python 79.27% <0.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

Copy link
Copy Markdown
Contributor

Assigning reviewers:

R: @claudevdm for label python.

Note: If you would like to opt out of this review, comment assign to next reviewer.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

@claudevdm claudevdm left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Are these milvus tests still running in any of the test suites? Can you confirm?

@aIbrahiim

Copy link
Copy Markdown
Contributor Author

Are these milvus tests still running in any of the test suites? Can you confirm?

yes, I checked and they're still running. There are currently two active Milvus integration test files:

  • ingestion/milvus_search_it_test.py
  • enrichment/milvus_search_it_test.py

Both are marked with @pytest.mark.require_docker_in_docker, and they are included in the PreCommit Python ML workflow and they run on the ubuntu latest runner with Python 3.13 and the failing job is the one that runs apache_beam/ml/ -m require_docker_in_docker, so the Milvus tests are definitely still part of the test suite and that's where the container startup timeout is happening

WARNING apache_beam.ml.rag.test_utils:test_utils.py:201 Retry 2/3: Failed to start Milvus DB container. Reason: Port mapping for container 166f055b71eda80e14ff7076a4c3d714e6af6ba1f718227eac3fe91c8c564b94 and port 43681 is not available.

`WARNING apache_beam.ml.rag.utils:utils.py:210 Milvus client connection
after container start attempt 1 failed: <MilvusException: (code=2,
message=Fail connecting to server on localhost:36461, illegal connection
params or server unavailable)>. Retrying in 2.00 seconds...

WARNING apache_beam.ml.rag.utils:utils.py:210 Milvus client connection
after container start attempt 2 failed: ... Retrying in 2.40 seconds...

... [attempts 3-21] ...

WARNING apache_beam.ml.rag.utils:utils.py:210 Milvus client connection
after container start attempt 21 failed: ... Retrying in 76.68 seconds.`

___ ERROR at setup of TestMilvusVectorWriterConfig.test_write_with_batching ____

@claudevdm

@aIbrahiim aIbrahiim requested a review from claudevdm June 18, 2026 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The PreCommit Python ML tests with ML deps installed job is flaky

2 participants