From b9c1999569a54a77c9eb7340dd9f3a86cb302862 Mon Sep 17 00:00:00 2001 From: Lukas Geiger Date: Mon, 12 Oct 2026 04:44:27 +0200 Subject: [PATCH 1/3] Diagnose Windows Python 3.12 pytest exit --- .github/workflows/tests.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ea1a9d3..5697a9a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -41,11 +41,37 @@ jobs: run: python -m ruff check . - name: Run tests + if: matrix.python-version != '3.12' env: QT_QPA_PLATFORM: offscreen PYTHONIOENCODING: utf-8 run: python -m pytest -q + - name: Diagnose Python 3.12 test process shutdown + if: matrix.python-version == '3.12' + shell: pwsh + env: + QT_QPA_PLATFORM: offscreen + PYTHONIOENCODING: utf-8 + run: | + $ErrorActionPreference = 'Continue' + $PSNativeCommandUseErrorActionPreference = $false + Write-Output "DIAGNOSTIC_START: Python 3.12 pytest" + python -c 'import importlib.metadata as m, sys; print("PYTHON_VERSION="+sys.version.split()[0]); print("PYTEST_VERSION="+m.version("pytest")); print("PYSIDE6_VERSION="+m.version("PySide6")); print("SHIBOKEN6_VERSION="+m.version("shiboken6"))' + $versionExitCode = $LASTEXITCODE + Write-Output "VERSION_PROBE_PROCESS_EXIT_CODE=$versionExitCode" + if ($versionExitCode -ne 0) { + Write-Output "DIAGNOSTIC_END: version probe failed" + exit $versionExitCode + } + Write-Output "PYTEST_PROCESS_START" + python -X faulthandler -m pytest -q + $pytestExitCode = $LASTEXITCODE + Write-Output "PYTEST_PROCESS_EXIT_CODE=$pytestExitCode" + Write-Output "PYTEST_PROCESS_END" + Write-Output "DIAGNOSTIC_END" + exit $pytestExitCode + - name: Compile Python sources env: PYTHONIOENCODING: utf-8 From 6b096409a4e9b637b0ffa37df6580d2a05a09f48 Mon Sep 17 00:00:00 2001 From: Lukas Geiger Date: Mon, 12 Oct 2026 04:48:21 +0200 Subject: [PATCH 2/3] Capture pytest shutdown status across Windows matrix --- .github/workflows/tests.yml | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5697a9a..d3ddfca 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -40,15 +40,7 @@ jobs: - name: Lint with ruff run: python -m ruff check . - - name: Run tests - if: matrix.python-version != '3.12' - env: - QT_QPA_PLATFORM: offscreen - PYTHONIOENCODING: utf-8 - run: python -m pytest -q - - - name: Diagnose Python 3.12 test process shutdown - if: matrix.python-version == '3.12' + - name: Diagnose Windows pytest process shutdown shell: pwsh env: QT_QPA_PLATFORM: offscreen @@ -56,7 +48,7 @@ jobs: run: | $ErrorActionPreference = 'Continue' $PSNativeCommandUseErrorActionPreference = $false - Write-Output "DIAGNOSTIC_START: Python 3.12 pytest" + Write-Output "DIAGNOSTIC_START: Windows pytest process" python -c 'import importlib.metadata as m, sys; print("PYTHON_VERSION="+sys.version.split()[0]); print("PYTEST_VERSION="+m.version("pytest")); print("PYSIDE6_VERSION="+m.version("PySide6")); print("SHIBOKEN6_VERSION="+m.version("shiboken6"))' $versionExitCode = $LASTEXITCODE Write-Output "VERSION_PROBE_PROCESS_EXIT_CODE=$versionExitCode" From 3cae09e270c260d0cc7e98069656b684a9bd6233 Mon Sep 17 00:00:00 2001 From: Lukas Geiger Date: Mon, 12 Oct 2026 04:59:10 +0200 Subject: [PATCH 3/3] ci: isolate Windows pytest shutdown failures by module --- .github/workflows/tests.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d3ddfca..8515b87 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -43,6 +43,7 @@ jobs: - name: Diagnose Windows pytest process shutdown shell: pwsh env: + PYTHON_VERSION: ${{ matrix.python-version }} QT_QPA_PLATFORM: offscreen PYTHONIOENCODING: utf-8 run: | @@ -61,6 +62,29 @@ jobs: $pytestExitCode = $LASTEXITCODE Write-Output "PYTEST_PROCESS_EXIT_CODE=$pytestExitCode" Write-Output "PYTEST_PROCESS_END" + if ($pytestExitCode -ne 0 -and $env:PYTHON_VERSION -in @('3.10', '3.11')) { + Write-Output "MODULE_DIAGNOSIS_START=full-suite-exit-$pytestExitCode" + $moduleFailures = @() + $testFiles = @(Get-ChildItem tests -Filter 'test_*.py' -File | Sort-Object Name) + foreach ($testFile in $testFiles) { + $relativePath = "tests/$($testFile.Name)" + Write-Output "MODULE_CHILD_START=$relativePath" + python -X faulthandler -m pytest -q $relativePath + $moduleExitCode = $LASTEXITCODE + Write-Output "MODULE_CHILD_EXIT_CODE=${relativePath}:$moduleExitCode" + if ($moduleExitCode -ne 0) { + $moduleFailures += "$relativePath=$moduleExitCode" + } + } + Write-Output "MODULE_CHILD_COUNT=$($testFiles.Count)" + if ($moduleFailures.Count -eq 0) { + Write-Output "MODULE_DIAGNOSIS_ALL_CHILDREN_EXITED_0; FULL_SUITE_REMAINS_FAILED=$pytestExitCode" + } else { + Write-Output "MODULE_DIAGNOSIS_FAILURES=$($moduleFailures -join '; ')" + Write-Output "FULL_SUITE_REMAINS_FAILED=$pytestExitCode" + } + Write-Output "MODULE_DIAGNOSIS_END" + } Write-Output "DIAGNOSTIC_END" exit $pytestExitCode