Skip to content

Commit

Permalink
test: force trigger segfault
Browse files Browse the repository at this point in the history
  • Loading branch information
XuehaiPan committed Nov 3, 2024
1 parent 5a3785c commit 731954e
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ jobs:
update-environment: true
allow-prereleases: true

- name: Upgrade pip
- name: Set up Environment
run: |
python -m pip install --upgrade pip setuptools wheel pybind11
Expand Down
25 changes: 18 additions & 7 deletions .github/workflows/tests-with-pydebug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,13 @@ jobs:
fi
fi
pyenv install ${{ env.PYTHON_VERSION }} "${PYENV_INSTALL_ARGS[@]}"
pyenv global ${{ env.PYTHON_VERSION }}
- name: Upgrade pip
- name: Set up Environment
shell: bash
run: |
pyenv versions
pyenv global "$(pyenv versions | grep -F '${{ env.PYTHON_VERSION }}' | tr -d ' ')"
python --version
python -c 'from pprint import pprint; import sysconfig; pprint(sysconfig.get_config_vars())'
python -m pip install --upgrade pip setuptools wheel
Expand All @@ -152,18 +154,23 @@ jobs:
)"
echo "PYTHON_TAG=${PYTHON_TAG}" | tee -a "${GITHUB_ENV}"
if [[ "${{ runner.os }}" != 'Windows' ]]; then
ulimit -c unlimited
if [[ "${{ runner.os }}" == 'Linux' ]]; then
sudo sysctl -w "kernel.core_pattern=core.%p.%i.%s.%e"
fi
fi
- name: Install OpTree
run: |
python -m pip install -vvv --editable '.[test]'
- name: Test with pytest
shell: bash
run: |
if [[ "${{ runner.os }}" != 'Windows' ]]; then
ulimit -c unlimited
fi
PYTESTOPTS=(
"--exitfirst"
"-k"
"max_depth"
"--cov-report=xml:coverage.${{ env.PYTHON_TAG }}.xml"
"--junit-xml=junit.${{ env.PYTHON_TAG }}.xml"
)
Expand All @@ -172,7 +179,11 @@ jobs:
- name: List generated files
if: ${{ !cancelled() }}
shell: bash
run: ls -alh tests
run: |
git status --porcelain --ignored tests
if [[ -x "$(command -v coredumpctl)" ]]; then
coredumpctl list
fi
- name: Upload JUnit results to Codecov
if: ${{ !cancelled() }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
update-environment: true
allow-prereleases: true

- name: Upgrade pip
- name: Set up Environment
shell: bash
run: |
python --version
Expand Down
4 changes: 2 additions & 2 deletions include/optree/treespec.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ using ssize_t = py::ssize_t;
#define Py_C_RECURSION_LIMIT 1000
#endif
#ifndef PYPY_VERSION
constexpr ssize_t MAX_RECURSION_DEPTH = std::min(1000, Py_C_RECURSION_LIMIT);
constexpr ssize_t MAX_RECURSION_DEPTH = 100000;
#else
constexpr ssize_t MAX_RECURSION_DEPTH = std::min(500, Py_C_RECURSION_LIMIT);
constexpr ssize_t MAX_RECURSION_DEPTH = 100000;
#endif

// Test whether the given object is a leaf node.
Expand Down

0 comments on commit 731954e

Please sign in to comment.