Skip to content

Commit 976fba8

Browse files
authored
Limit the number of parallel tests in SDK execution tests (kubeflow#11680)
Often times, pods could not be scheduled because of insufficient CPU and the worker would run out of disk space. Signed-off-by: mprahl <[email protected]>
1 parent 30d7c39 commit 976fba8

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

.github/workflows/sdk-execution.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ jobs:
6969
run: |
7070
export KFP_ENDPOINT="http://localhost:8888"
7171
export TIMEOUT_SECONDS=2700
72-
pytest ./test/sdk-execution-tests/sdk_execution_tests.py --asyncio-task-timeout $TIMEOUT_SECONDS
72+
pytest -v -n 5 ./test/sdk-execution-tests/sdk_execution_tests.py
7373
continue-on-error: true
7474

7575
- name: Collect failed logs
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
sdk/python
22
pytest==8.3.2
3-
pytest-asyncio-cooperative==0.37.0
3+
pytest-xdist==2.5.0

test/sdk-execution-tests/sdk_execution_tests.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
import asyncio
1514
import dataclasses
1615
import functools
1716
import os
@@ -112,18 +111,15 @@ def get_kfp_package_path() -> str:
112111
dsl.component, kfp_package_path=get_kfp_package_path())
113112

114113

115-
@pytest.mark.asyncio_cooperative
116114
@pytest.mark.parametrize('test_case', create_test_case_parameters())
117-
async def test(test_case: TestCase) -> None:
118-
"""Asynchronously runs all samples and test that they succeed."""
119-
event_loop = asyncio.get_running_loop()
115+
def test(test_case: TestCase) -> None:
120116
try:
121117
run_url, run_result = run(test_case)
122118
except Exception as e:
123119
raise RuntimeError(
124120
f'Error triggering pipeline {test_case.name}.') from e
125121

126-
api_run = await event_loop.run_in_executor(None, wait, run_result)
122+
api_run = wait(run_result)
127123
assert api_run.state == test_case.expected_state, f'Pipeline {test_case.name} ended with incorrect status: {api_run.state}. More info: {run_url}'
128124

129125

0 commit comments

Comments
 (0)