Repository navigation
Limit testcontainersTest xdist concurrency and avoid overlap with postCommitPyIT - #41777
Conversation
|
/gemini review |
There was a problem hiding this comment.
📋 Review Summary
This PR mitigates DinD /run tmpfs exhaustion during Python PostCommit runs by serializing :sdks:python:test-suites:direct:py*:testcontainersTest after :sdks:python:test-suites:portable:py*:postCommitPy*IT and lowering pytest-xdist concurrency from 8 to 2 workers for testcontainersTest. The changes in sdks/python/test-suites/direct/common.gradle are clean, targeted, and directly address the container burst root cause.
🔍 General Feedback
- Using
mustRunAfterwith the interpolatedpythonVersionSuffixproperly orders the direct and portable suites when both are part of the task graph (such as inpython313PostCommit) without introducing an unnecessary hard dependency when runningtestcontainersTeststandalone. - Capping
--numprocessesto 2 fortestcontainersTestsignificantly reduces concurrent container creation overhead on the shared DinD sidecar.
💡 Tip: Comment /gemini review on this pull request to trigger a new Gemini code review.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #41777 +/- ##
============================================
+ Coverage 58.12% 58.19% +0.07%
Complexity 2843 2843
============================================
Files 1211 1211
Lines 173473 173799 +326
Branches 2329 2329
============================================
+ Hits 100824 101149 +325
- Misses 69940 69941 +1
Partials 2709 2709
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
/gemini review |
There was a problem hiding this comment.
📋 Review Summary
This PR mitigates DinD /run tmpfs exhaustion during PostCommit Python runs by reducing pytest-xdist concurrency (--numprocesses=2) for testcontainersTest and ordering it after postCommitPy${pythonVersionSuffix}IT. The refactoring of shared pytest options into commonTestOpts alongside dedicated basicTestOpts and testcontainersTestOpts in sdks/python/test-suites/direct/common.gradle is clean, idiomatic, and well-scoped.
🔍 General Feedback
- Factoring out
commonTestOptsavoids brittle list transformations while keeping test option sets explicit. - Using
mustRunAfterappropriately prevents overlapping container bursts when both tasks are in the execution graph without introducing an unnecessary hard dependency when runningtestcontainersTeststandalone.
💡 Tip: Comment /gemini review on this pull request to trigger a new Gemini code review.
|
Assigning reviewers: R: @shunping for label python. Note: If you would like to opt out of this review, comment Available commands:
The PR bot will only process comments in the main thread (not review comments). |
Note: this PR was auto-generated by tooling. Before moving it out of draft, the author has done a full review of the PR, specifically evaluating it on the following criteria:
Full details of the methodology of generation and review can be found here - https://docs.google.com/document/d/14lj7ECVov4T4EdwmIzNlWrRGE3lLDMOwX5xUMGzaLoc/edit?usp=sharing
If you have concerns with the PR or with the underlying methodology used to generate this, please comment below - they will be addressed by the author not the tooling :)
Summary
Fixes repeated DinD
/runtmpfs exhaustion (io.containerd.runc.v2: write /run/docker/containerd/daemon/...: no space left on device) inPostCommit Python(py313), which occurred 6 times in 7 days across 7 distincthighmem22pods (runs https://github.com/apache/beam/actions/runs/45665899847, https://github.com/apache/beam/actions/runs/45868651102, https://github.com/apache/beam/actions/runs/45946466565, https://github.com/apache/beam/actions/runs/46112600361, https://github.com/apache/beam/actions/runs/46171031694, https://github.com/apache/beam/actions/runs/46202099310, and https://github.com/apache/beam/actions/runs/46360492005).Root Cause
Since
#41648unskipped the 35 Redisuses_testcontainertests,:sdks:python:test-suites:direct:py313:testcontainersTestran withbasicTestOpts's--numprocesses=8concurrently with:sdks:python:test-suites:portable:py313:postCommitPy313IT(CrossLanguageDebeziumIOTest, launchinglocalstack,debezium/example-postgres, andapache/beam_java21_sdk). The combined container burst transiently exhausts thedocker:24.0.7-dind-alpine3.18sidecar's/runtmpfs.Changes
sdks/python/test-suites/direct/common.gradle: Factor shared pytest options intocommonTestOpts, define a dedicatedtestcontainersTestOpts(--numprocesses=2) alongsidebasicTestOpts(--numprocesses=8), usetestcontainersTestOptsintestcontainersTest, and addmustRunAfter ":sdks:python:test-suites:portable:py${pythonVersionSuffix}:postCommitPy${pythonVersionSuffix}IT".Verification
beam_PostCommit_Python.ymlworkflow run on branch:47130183867(prior passing run before refactor:46452371330)