Skip to content

test(truthbench): simulate the native crash instead of raising SIGSEGV - #222

Merged
kevincostner17 merged 1 commit into
mainfrom
fix/test-no-real-segv
Sep 14, 2026
Merged

kevincostner17 merged 1 commit into
mainfrom
fix/test-no-real-segv

Conversation

@kevincostner17

Copy link
Copy Markdown
Contributor

Summary

test_native_crash_reports_signal_exit_and_faulthandler_dump killed a real child interpreter with SIGSEGV. On macOS every local pytest run therefore filed a crash report under ~/Library/Logs/DiagnosticReports (and could pop the "Python quit unexpectedly" dialog), once per interpreter. With several sessions running the suite that was dozens of Python crash reports a night, which read like real -11 flakes.

The test only needs the harness to turn a negative exit code plus a faulthandler dump into a failure. It now stubs subprocess.run in benchmarks.truthbench.generated_code to return exactly that. That -X faulthandler and the pinned thread env reach the child is still checked end to end by test_sandbox_pins_native_threads_and_enables_faulthandler.

No production code changes.

Test plan

  • tests/truthbench/test_generated_code.py on Python 3.9.6 / pandas 1.5.3 and on Python 3.12: 20 passed
  • Full pytest -m "not online and not large" lane on Python 3.9: 4170 passed, 6 skipped
  • ruff check clean
  • No new crash reports from the run

Killing a real child with SIGSEGV made macOS write a crash report (and
possibly show a dialog) on every local pytest run, on each interpreter.
The test only needs the harness to turn a negative exit code and the
faulthandler dump into a failure, so return that from a stubbed
subprocess.run. The -X faulthandler argv is still covered by
test_sandbox_pins_native_threads_and_enables_faulthandler.
@coderabbitai

coderabbitai Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 31c5de1c-40bd-4e72-bd07-6fad46e48767


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@kevincostner17
kevincostner17 merged commit a19c31c into main Sep 14, 2026
18 checks passed
@kevincostner17
kevincostner17 deleted the fix/test-no-real-segv branch September 14, 2026 20:05
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