|
71 | 71 | test: |
72 | 72 | name: Test Python ${{ matrix.python-version }}${{ matrix.experimental && ' (experimental)' || '' }} |
73 | 73 | runs-on: ${{ inputs.runner-version }} |
| 74 | + timeout-minutes: 20 |
74 | 75 | continue-on-error: ${{ matrix.experimental || false }} |
75 | 76 | outputs: |
76 | 77 | benchmark-available: ${{ steps.benchmark-compare.outputs.benchmark-available }} |
@@ -201,17 +202,19 @@ jobs: |
201 | 202 | MISE_PYTHON_VERSION: ${{ steps.setup-mise.outputs.MISE_PYTHON_VERSION }} |
202 | 203 | TEST_MARKERS: ${{ inputs.test-markers }} |
203 | 204 | run: | |
204 | | - # Real-provider tests: bump timeout to 15min per test and switch |
205 | | - # the timeout method to `signal` so SIGALRM can interrupt |
206 | | - # blocking C code (ONNX runtime inference). The default `thread` |
207 | | - # method in pyproject.toml can't kill stuck native code, so a |
208 | | - # genuinely hung embedding call would run until the 6h GHA |
209 | | - # job limit. `signal` has asyncio interaction caveats but |
210 | | - # they're acceptable for the integration suite. |
| 205 | + # On Linux/macOS, use `signal` timeout method so SIGALRM can |
| 206 | + # interrupt blocking C code (ONNX runtime, model loading). |
| 207 | + # On Windows, `signal` is not supported by pytest-timeout — |
| 208 | + # fall back to the default `thread` method from pyproject.toml. |
| 209 | + TIMEOUT_ARGS="" |
| 210 | + if [[ "$RUNNER_OS" != "Windows" ]]; then |
| 211 | + TIMEOUT_ARGS="--timeout-method=signal" |
| 212 | + fi |
| 213 | +
|
211 | 214 | if [[ "${TEST_MARKERS}" == *"real_providers"* ]]; then |
212 | | - mise run test-cov -m "${TEST_MARKERS}" --timeout=900 --timeout-method=signal |
| 215 | + mise run test-cov -m "${TEST_MARKERS}" --timeout=900 ${TIMEOUT_ARGS} |
213 | 216 | else |
214 | | - mise run test-cov -m "${TEST_MARKERS}" |
| 217 | + mise run test-cov -m "${TEST_MARKERS}" ${TIMEOUT_ARGS} |
215 | 218 | fi |
216 | 219 | - name: Upload coverage to Codecov |
217 | 220 | if: ${{ inputs.upload-coverage && matrix.python-version == '3.12' && !inputs.benchmark-tests }} |
|
0 commit comments