Skip to content

Commit

Permalink
ci: split x86 pytests by directory
Browse files Browse the repository at this point in the history
Windows x86 ci runs can fail because the container runs out of memory
during testing. This is caused by memory leaks in psyneulink and limited
available memory on the containers. As a workaround, running several
pytest commands for each subdirectory tested reduces peak memory usage.
  • Loading branch information
kmantel committed Apr 16, 2024
1 parent c6f2479 commit 8a6156e
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion .github/workflows/pnl-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,27 @@ jobs:
Windows*) wmic cpu get description,currentclockspeed,NumberOfCores,NumberOfEnabledCore,NumberOfLogicalProcessors; wmic memorychip get capacity,speed,status,manufacturer ;;
esac
- name: Test with pytest
- name: Test with pytest (non-x86)
timeout-minutes: 180
run: pytest --junit-xml=tests_out.xml --verbosity=0 -n logical ${{ matrix.extra-args }}
if: (! contains(matrix.python-architecture, 'x86'))

# run tests in each dir separately to reduce peak memory usage
- name: Test with pytest (x86)
timeout-minutes: 180
shell: bash
# any non-zero exit code will indicate failure for GHA
run: |
test_dirs=$(find psyneulink tests/* -maxdepth 0 -type d)
for td in $test_dirs; do echo "Running pytest $td"; pytest --junit-xml=tests_$(echo $td | sed 's;/;_;g').xml --verbosity=0 -n logical ${{ matrix.extra-args }} "$td"; done
if: contains(matrix.python-architecture, 'x86')

- name: Merge junit xml (x86)
shell: bash
run: |
pip install junitparser
junitparser merge tests*.xml tests_out.xml
if: contains(matrix.python-architecture, 'x86')

- name: Upload test results
uses: actions/upload-artifact@v4
Expand Down

0 comments on commit 8a6156e

Please sign in to comment.