Repository navigation
test(truthbench): simulate the native crash instead of raising SIGSEGV - #222
Merged
Merged
Conversation
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.
Contributor
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 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. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
test_native_crash_reports_signal_exit_and_faulthandler_dumpkilled a real child interpreter withSIGSEGV. 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-11flakes.The test only needs the harness to turn a negative exit code plus a faulthandler dump into a failure. It now stubs
subprocess.runinbenchmarks.truthbench.generated_codeto return exactly that. That-X faulthandlerand the pinned thread env reach the child is still checked end to end bytest_sandbox_pins_native_threads_and_enables_faulthandler.No production code changes.
Test plan
tests/truthbench/test_generated_code.pyon Python 3.9.6 / pandas 1.5.3 and on Python 3.12: 20 passedpytest -m "not online and not large"lane on Python 3.9: 4170 passed, 6 skippedruff checkclean