Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb817890

Browse files
committed
Run subprocess-starting tests without pytest-xdist
I suspect that we are running out of process IDs, or the scheduleris not letting all subprocesses execute, leading to timeouts intests that start subprocesses when other long-running tests areexecuting. This happens often with Python 3.14 tests for some reason.Add a new pytest marker for the tests that start a subprocess attop level, and run these tests in a separate pass withoutpytest-xdist parallelization.
1 parentede1ebb commitb817890

16 files changed

+48
-7
lines changed

‎.github/workflows/tests.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -337,9 +337,18 @@ jobs:
337337
if [[ "${{ matrix.python-version }}" == '3.13t' ]]; then
338338
export PYTHON_GIL=0
339339
fi
340-
pytest -rfEsXR -n auto \
341-
--maxfail=50 --timeout=300 --durations=25 \
342-
--cov-report=xml --cov=lib --log-level=DEBUG --color=yes
340+
FLAGS=(
341+
-rfEsXR
342+
--maxfail=50
343+
--timeout=300
344+
--durations=25
345+
--cov-report=xml
346+
--cov=lib
347+
--log-level=DEBUG
348+
--color=yes
349+
)
350+
pytest "${FLAGS[@]}" -m 'not subprocess' -n auto
351+
pytest "${FLAGS[@]}" -m subprocess
343352
344353
-name:Cleanup non-failed image files
345354
if:failure()

‎azure-pipelines.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,18 @@ stages:
120120
121121
echo "##vso[task.setvariable variable=VS_COVERAGE_TOOL]$TOOL"
122122
123-
PYTHONFAULTHANDLER=1 pytest -rfEsXR -n 2 \
124-
--maxfail=50 --timeout=300 --durations=25 \
125-
--junitxml=junit/test-results.xml --cov-report=xml --cov=lib
123+
FLAGS=(
124+
-rfEsXR
125+
--maxfail=50
126+
--timeout=300
127+
--durations=25
128+
--cov-report=xml
129+
--cov=lib
130+
)
131+
PYTHONFAULTHANDLER=1 pytest "${FLAGS[@]}" -m 'not subprocess' -n 2 \
132+
--junitxml=junit/test-results-1.xml
133+
PYTHONFAULTHANDLER=1 pytest "${FLAGS[@]}" -m subprocess \
134+
--junitxml=junit/test-results-2.xml
126135
127136
if [[ $VS_VER == 2022 ]]; then
128137
"$TOOL" shutdown $SESSION_ID
@@ -153,7 +162,8 @@ stages:
153162
154163
-task:PublishTestResults@2
155164
inputs:
156-
testResultsFiles:'**/test-results.xml'
165+
mergeTestResults:true
166+
testResultsFiles:'**/test-results*.xml'
157167
testRunTitle:'Python $(python.version)'
158168
condition:succeededOrFailed()
159169

‎lib/matplotlib/testing/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ def pytest_configure(config):
1515
("markers","backend: Set alternate Matplotlib backend temporarily."),
1616
("markers","baseline_images: Compare output against references."),
1717
("markers","pytz: Tests that require pytz to be installed."),
18+
("markers","subprocess: Tests that start a subprocess."),
1819
("filterwarnings","error"),
1920
("filterwarnings",
2021
"ignore:.*The py23 module has been deprecated:DeprecationWarning"),

‎lib/matplotlib/tests/test_backend_inline.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
pytest.importorskip('nbconvert')
1111
pytest.importorskip('ipykernel')
1212
pytest.importorskip('matplotlib_inline')
13+
pytestmark=pytest.mark.subprocess
1314

1415

1516
deftest_ipynb():

‎lib/matplotlib/tests/test_backend_nbagg.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
nbformat=pytest.importorskip('nbformat')
1010
pytest.importorskip('nbconvert')
1111
pytest.importorskip('ipykernel')
12+
pytestmark=pytest.mark.subprocess
1213

1314
# From https://blog.thedataincubator.com/2016/06/testing-jupyter-notebooks/
1415

‎lib/matplotlib/tests/test_backend_webagg.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
frommatplotlib.testingimportsubprocess_run_for_testing
77

88

9+
@pytest.mark.subprocess
910
@pytest.mark.parametrize("backend", ["webagg","nbagg"])
1011
deftest_webagg_fallback(backend):
1112
pytest.importorskip("tornado")

‎lib/matplotlib/tests/test_backends_interactive.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
frommatplotlib.testingimportsubprocess_run_helperas_run_helper,is_ci_environment
2323

2424

25+
pytestmark=pytest.mark.subprocess
26+
27+
2528
class_WaitForStringPopen(subprocess.Popen):
2629
"""
2730
A Popen that passes flags that allow triggering KeyboardInterrupt.

‎lib/matplotlib/tests/test_basic.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
frommatplotlib.testingimportsubprocess_run_for_testing
77

8+
importpytest
9+
810

911
deftest_simple():
1012
assert1+1==2
@@ -28,6 +30,7 @@ def test_override_builtins():
2830
assertoverridden<=ok_to_override
2931

3032

33+
@pytest.mark.subprocess
3134
deftest_lazy_imports():
3235
source=textwrap.dedent("""
3336
import sys

‎lib/matplotlib/tests/test_determinism.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
frommatplotlib.textimportTextPath
2222
frommatplotlib.transformsimportIdentityTransform
2323

24+
pytestmark=pytest.mark.subprocess
25+
2426

2527
def_save_figure(objects='mhip',fmt="pdf",usetex=False):
2628
mpl.use(fmt)

‎lib/matplotlib/tests/test_font_manager.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,7 @@ def test_fontcache_thread_safe():
288288
subprocess_run_helper(_test_threading,timeout=10)
289289

290290

291+
@pytest.mark.subprocess
291292
deftest_lockfilefailure(tmp_path):
292293
# The logic here:
293294
# 1. get a temp directory from pytest

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp