Skip to content

Commit

Permalink
Use pytest-xdist worksteal where possible
Browse files Browse the repository at this point in the history
  • Loading branch information
qc00 committed Dec 8, 2023
1 parent 439e666 commit 75ad4ba
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,14 @@ jobs:
include:
- python_deps_ids: [""]
matrix_override: ${{fromJson(needs.common_config.outputs.linux_matrix)}}
pytest_xdist_mode: "--dist worksteal"
- python3: 6
python_deps_ids: ["", -compat36]
matrix_override:
- ${{fromJson(needs.common_config.outputs.linux_matrix)[0]}}
- python_deps_id: -compat36
python_deps: requirements-compatibility-py36.txt
pytest_xdist_mode: "" # worksteal Not supported on Python 3.6
- python3: 8
python_deps_ids: ["", -compat38]
matrix_override:
Expand All @@ -193,6 +195,7 @@ jobs:
python_deps_ids: ${{toJson(matrix.python_deps_ids)}}
persistent_storage: ${{inputs.persistent_storage}}
compile-override: compile-on-ec2
pytest_xdist_mode: ${{matrix.pytest_xdist_mode}}

cpp-test-windows:
needs: [common_config]
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/build_steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
python_deps_ids: {default: '[""]', type: string, description: build-python-wheels test matrix parameter. JSON string.}
python3: {default: -1, type: number, description: Python 3 minor version}
persistent_storage: {default: "false", type: string, description: Specifies whether the python tests should tests against real storages e.g. AWS S3 }
pytest_xdist_mode: {default: "", type: string, description: additional argument to pass for pytest-xdist}
jobs:
start_ec2_runner:
if: inputs.compile-override == 'compile-on-ec2'
Expand Down Expand Up @@ -314,6 +315,7 @@ jobs:
# Use the Mongo created in the service container above to test against
CI_MONGO_HOST: mongodb
HYPOTHESIS_PROFILE: ci_${{matrix.os}}
PYTEST_XDIST_MODE: ${{inputs.pytest_xdist_mode}}

- name: Collect crash dumps (Windows)
if: matrix.os == 'windows' && failure()
Expand Down
2 changes: 1 addition & 1 deletion build_tooling/parallel_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ catch=`{ which catchsegv 2>/dev/null || echo ; } | tail -n 1`

export ARCTICDB_RAND_SEED=$RANDOM

$catch python -m pytest -n $splits -v --log-file="$TEST_OUTPUT_DIR/pytest-logger.$group.log" \
$catch python -m pytest -n $splits $PYTEST_XDIST_MODE -v --log-file="$TEST_OUTPUT_DIR/pytest-logger.$group.log" \
--junitxml="$TEST_OUTPUT_DIR/pytest.$group.xml" \
--basetemp="$PARALLEL_TEST_ROOT/temp-pytest-output" \
"$@" 2>&1 | sed -ur "s#^(tests/.*/([^/]+\.py))?#\2#"

0 comments on commit 75ad4ba

Please sign in to comment.