Skip to content

Report crashes of the test process in CI logs - #405

Merged
PierreRaybaut merged 1 commit into
developfrom
fix/ci-segfault-diagnostics
Oct 20, 2026
Merged

PierreRaybaut merged 1 commit into
developfrom
fix/ci-segfault-diagnostics

Conversation

@PierreRaybaut

Copy link
Copy Markdown
Contributor

After #402 was merged, the PyQt5 / Python 3.9 job on develop crashed twice with a segmentation fault (exit code 139) at the start of side_by_side_app_test.py::test_view_images_side_by_side (run 39420412512, both attempts), while the same tree had passed on the PR branch with identical dependencies. The logs contained no traceback at all, so the crash could not be analyzed.

Why no traceback was reported

The application context (sigimax_app_context) redirects faulthandler to .DataLab_faulthandler.log in the configuration directory, then disables it on exit, which also disables pytest's own handler for every subsequent test. Crash tracebacks therefore ended up in a file left on the runner, or nowhere.

Changes

  • Tests (datalab/tests/conftest.py): the faulthandler_enabled option is disabled in tests, so that pytest's faulthandler stays active and reports crash tracebacks in the test output. Checked locally: without this change, a crash in an application context prints nothing in the pytest output; with it, the traceback points to the crashing test line.
  • PyQt5 workflow: the core dump of a crashed test process is kept, and its native backtrace (all threads) is printed by a step that runs on failure only.

Notes

  • Three manual runs on this branch were green: the crash depends on garbage collection timing, which changes with the run metadata. It occurred on push runs on develop, so merging this is the best way to capture its traceback if it happens again.
  • Diagnostics only: the crash itself is not fixed here.

A test process crash left no Python traceback in the CI logs: the DataLab
application context redirected faulthandler to a log file kept on the runner,
then disabled it, including pytest's own handler, for all subsequent tests.

Tests now keep pytest's faulthandler, so that crash tracebacks are reported in
the test output. The PyQt5 workflow also keeps the core dump of a crashed test
process and prints its native backtrace.

Assisted-by: Claude Opus 5.5
@PierreRaybaut
PierreRaybaut merged commit 618c95d into develop Oct 20, 2026
15 checks passed
@PierreRaybaut
PierreRaybaut deleted the fix/ci-segfault-diagnostics branch October 23, 2026 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant