ci: add timeout debugging for Python 3.13 pytest hanging issue
- Added timeout --signal=INT to pytest runs on Python 3.13 - This will interrupt hanging tests and provide full traceback - Added extra debugging steps for Python 3.13 to isolate the issue: - Test collection only with timeout - Run single simple test with timeout - Reference: https://youtu.be/QRywzsBftfc (debugging hanging tests) - Will help identify if hanging occurs during collection or execution
This commit is contained in:
35
.github/workflows/build-reusable.yml
vendored
35
.github/workflows/build-reusable.yml
vendored
@@ -223,6 +223,23 @@ jobs:
|
|||||||
python -c "from leann_backend_diskann import _diskannpy; print('_diskannpy imported successfully')" || echo "Failed to import _diskannpy"
|
python -c "from leann_backend_diskann import _diskannpy; print('_diskannpy imported successfully')" || echo "Failed to import _diskannpy"
|
||||||
ls -la $(python -c "import leann_backend_diskann; import os; print(os.path.dirname(leann_backend_diskann.__file__))" 2>/dev/null) 2>/dev/null || echo "Failed to list module directory"
|
ls -la $(python -c "import leann_backend_diskann; import os; print(os.path.dirname(leann_backend_diskann.__file__))" 2>/dev/null) 2>/dev/null || echo "Failed to list module directory"
|
||||||
|
|
||||||
|
# Extra debugging for Python 3.13
|
||||||
|
if [[ "${{ matrix.python }}" == "3.13" ]]; then
|
||||||
|
echo "=== Python 3.13 Debug Info ==="
|
||||||
|
echo "Python version details:"
|
||||||
|
python --version
|
||||||
|
python -c "import sys; print(f'sys.version_info: {sys.version_info}')"
|
||||||
|
|
||||||
|
echo "Pytest version:"
|
||||||
|
python -m pytest --version
|
||||||
|
|
||||||
|
echo "Testing basic pytest collection with timeout:"
|
||||||
|
timeout --signal=INT 10 python -m pytest --collect-only tests/test_ci_minimal.py -v || echo "Collection timed out or failed"
|
||||||
|
|
||||||
|
echo "Testing single simple test with timeout:"
|
||||||
|
timeout --signal=INT 10 python -m pytest tests/test_ci_minimal.py::test_package_imports --full-trace -v || echo "Simple test timed out or failed"
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Run tests with pytest
|
- name: Run tests with pytest
|
||||||
env:
|
env:
|
||||||
CI: true # Mark as CI environment to skip memory-intensive tests
|
CI: true # Mark as CI environment to skip memory-intensive tests
|
||||||
@@ -236,8 +253,22 @@ jobs:
|
|||||||
# Activate virtual environment
|
# Activate virtual environment
|
||||||
source .venv/bin/activate || source .venv/Scripts/activate
|
source .venv/bin/activate || source .venv/Scripts/activate
|
||||||
|
|
||||||
# Run all tests
|
# Run all tests with timeout to debug Python 3.13 hanging issue
|
||||||
pytest tests/
|
# Using timeout with INT signal to get full traceback when hanging
|
||||||
|
if [[ "${{ matrix.python }}" == "3.13" ]]; then
|
||||||
|
echo "Running tests with timeout for Python 3.13 debugging..."
|
||||||
|
timeout --signal=INT 120 pytest tests/ --full-trace -v || {
|
||||||
|
EXIT_CODE=$?
|
||||||
|
if [ $EXIT_CODE -eq 124 ]; then
|
||||||
|
echo "⚠️ Tests timed out after 120 seconds - likely hanging during collection"
|
||||||
|
echo "This is a known issue with Python 3.13 - see traceback above for details"
|
||||||
|
fi
|
||||||
|
exit $EXIT_CODE
|
||||||
|
}
|
||||||
|
else
|
||||||
|
# Normal test run for other Python versions
|
||||||
|
pytest tests/
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Run sanity checks (optional)
|
- name: Run sanity checks (optional)
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
Reference in New Issue
Block a user