Skip to content

Commit 34bedad

Browse files
authored
[Experimental] Fix Yaml Xlang Test Timeout (#38798)
* [Experiment] Try single pip call + uv usage * update workflow for 310 ml deps * sickbay the test suite * formatting
1 parent f88c260 commit 34bedad

4 files changed

Lines changed: 19 additions & 11 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"comment": "Modify this file in a trivial way to cause this test suite to run",
3-
"revision": 1
3+
"revision": 2
44
}

.github/workflows/beam_PreCommit_Yaml_Xlang_Direct.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ jobs:
9191
- name: run PreCommit Yaml Xlang Direct script
9292
uses: ./.github/actions/gradle-command-self-hosted-action
9393
with:
94-
gradle-command: :sdks:python:yamlIntegrationTests -PbeamPythonExtra=ml_test,yaml
94+
gradle-command: :sdks:python:yamlIntegrationTests -PbeamPythonExtra=p310_ml_test,yaml
9595
- name: Archive Python Test Results
9696
uses: actions/upload-artifact@v7
9797
if: failure()

buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3139,15 +3139,13 @@ class BeamModulePlugin implements Plugin<Project> {
31393139
def distTarBall = "${pythonRootDir}/build/apache-beam.tar.gz"
31403140
def packages = "gcp,test,aws,azure,dataframe"
31413141
def extra = project.findProperty('beamPythonExtra')
3142+
def installTargets = "${distTarBall}[${packages}]"
3143+
if (extra) {
3144+
installTargets = "${distTarBall}[${packages},${extra}]"
3145+
}
31423146
project.exec {
31433147
executable 'sh'
3144-
args '-c', ". ${project.ext.envdir}/bin/activate && pip install --pre --retries 10 ${distTarBall}[${packages}]"
3145-
}
3146-
if (extra) {
3147-
project.exec {
3148-
executable 'sh'
3149-
args '-c', ". ${project.ext.envdir}/bin/activate && pip install --pre --retries 10 ${distTarBall}[${extra}]"
3150-
}
3148+
args '-c', ". ${project.ext.envdir}/bin/activate && pip install uv && uv pip install --pre ${installTargets}"
31513149
}
31523150
}
31533151
}

sdks/python/apache_beam/yaml/integration_tests.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -790,6 +790,11 @@ def test(self, providers=providers): # default arg to capture loop value
790790
yield f'test_{suffix}', test
791791

792792

793+
_SICKBAY_TESTS = {
794+
'ml_transform.yaml': 'Requires broken TFT dependency types (e.g. ScaleTo01)',
795+
}
796+
797+
793798
def parse_test_files(filepattern):
794799
"""Parses YAML test files and dynamically creates test cases.
795800
@@ -810,13 +815,18 @@ def parse_test_files(filepattern):
810815
"""
811816
for path in glob.glob(filepattern):
812817
with open(path) as fin:
813-
suite_name = os.path.splitext(os.path.basename(path))[0].title().replace(
818+
filename = os.path.basename(path)
819+
suite_name = os.path.splitext(filename)[0].title().replace(
814820
'-', '') + 'Test'
815821
print(path, suite_name)
816822
methods = dict(
817823
create_test_methods(
818824
yaml.load(fin, Loader=yaml_transform.SafeLineLoader)))
819-
globals()[suite_name] = type(suite_name, (unittest.TestCase, ), methods)
825+
suite_class = type(suite_name, (unittest.TestCase, ), methods)
826+
if filename in _SICKBAY_TESTS:
827+
suite_class = unittest.skip(f"Sickbayed: {_SICKBAY_TESTS[filename]}")(
828+
suite_class)
829+
globals()[suite_name] = suite_class
820830

821831

822832
# Logging setups

0 commit comments

Comments
 (0)