Skip to content

Commit f40f18e

Browse files
authored
CI: force software rendering to fix flaky VTK off-screen bus error (#1078) (#1084)
Isolates the three VTK/PyVista off-screen animation tests into their own workflow step so a native crash in one of them no longer kills the whole integration run, adds a bounded retry for the crash, forces Mesa software rendering on Linux, and sets fail-fast: false so one platform no longer cancels the rest of the matrix. Closes #1078
1 parent 2cca437 commit f40f18e

2 files changed

Lines changed: 58 additions & 2 deletions

File tree

‎.github/workflows/test-pytest-slow.yaml‎

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ jobs:
2525
env:
2626
PYTHON: ${{ matrix.python-version }}
2727
MPLBACKEND: Agg
28+
LIBGL_ALWAYS_SOFTWARE: "1"
29+
GALLIUM_DRIVER: llvmpipe
2830
steps:
2931
- uses: actions/checkout@main
3032
- name: Set up headless display
@@ -52,7 +54,31 @@ jobs:
5254
run: pytest rocketpy --doctest-modules --cov=rocketpy --cov-append
5355

5456
- name: Run Integration Tests
55-
run: pytest tests/integration --cov=rocketpy --cov-append
57+
run: |
58+
pytest tests/integration \
59+
--deselect tests/integration/test_plots.py::test_flight_animations_run_off_screen \
60+
--deselect tests/integration/test_plots.py::test_flight_animations_render_all_scene_options \
61+
--deselect tests/integration/test_plots.py::test_flight_animation_export_gif \
62+
--cov=rocketpy --cov-append
63+
64+
- name: Run VTK animation tests
65+
run: |
66+
tests=(
67+
tests/integration/test_plots.py::test_flight_animations_run_off_screen
68+
tests/integration/test_plots.py::test_flight_animations_render_all_scene_options
69+
tests/integration/test_plots.py::test_flight_animation_export_gif
70+
)
71+
attempts=3
72+
for attempt in $(seq 1 "$attempts"); do
73+
if pytest "${tests[@]}" --cov=rocketpy --cov-append; then
74+
exit 0
75+
else
76+
status=$?
77+
fi
78+
if [[ "$status" != "138" || "$attempt" == "$attempts" ]]; then
79+
exit "$status"
80+
fi
81+
done
5682
5783
- name: Run Acceptance Tests
5884
run: pytest tests/acceptance --cov=rocketpy --cov-append --cov-report=xml

‎.github/workflows/test_pytest.yaml‎

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
Pytest:
1818
runs-on: ${{ matrix.os }}
1919
strategy:
20+
fail-fast: false
2021
matrix:
2122
os: [ubuntu-latest, macos-latest, windows-latest]
2223
python-version: ["3.10", "3.14"]
@@ -28,6 +29,11 @@ jobs:
2829
- uses: actions/checkout@main
2930
- name: Set up headless display
3031
uses: pyvista/setup-headless-display-action@v4
32+
- name: Configure Mesa software rendering on Linux
33+
if: runner.os == 'Linux'
34+
run: |
35+
echo "LIBGL_ALWAYS_SOFTWARE=1" >> "$GITHUB_ENV"
36+
echo "GALLIUM_DRIVER=llvmpipe" >> "$GITHUB_ENV"
3137
- name: Set up Python
3238
uses: actions/setup-python@main
3339
with:
@@ -58,7 +64,31 @@ jobs:
5864
pytest rocketpy --doctest-modules --cov=rocketpy --cov-append
5965
6066
- name: Run Integration Tests
61-
run: pytest tests/integration --cov=rocketpy --cov-append
67+
run: |
68+
pytest tests/integration \
69+
--deselect tests/integration/test_plots.py::test_flight_animations_run_off_screen \
70+
--deselect tests/integration/test_plots.py::test_flight_animations_render_all_scene_options \
71+
--deselect tests/integration/test_plots.py::test_flight_animation_export_gif \
72+
--cov=rocketpy --cov-append
73+
74+
- name: Run VTK animation tests
75+
run: |
76+
tests=(
77+
tests/integration/test_plots.py::test_flight_animations_run_off_screen
78+
tests/integration/test_plots.py::test_flight_animations_render_all_scene_options
79+
tests/integration/test_plots.py::test_flight_animation_export_gif
80+
)
81+
attempts=3
82+
for attempt in $(seq 1 "$attempts"); do
83+
if pytest "${tests[@]}" --cov=rocketpy --cov-append; then
84+
exit 0
85+
else
86+
status=$?
87+
fi
88+
if [[ "$status" != "138" || "$attempt" == "$attempts" ]]; then
89+
exit "$status"
90+
fi
91+
done
6292
6393
- name: Run Acceptance Tests
6494
run: pytest tests/acceptance --cov=rocketpy --cov-append --cov-report=xml

0 commit comments

Comments
 (0)