Skip to content

fix(native): let WER finish native crash reports#1904

Merged
jpnurmi merged 3 commits into
masterfrom
jpnurmi/fix/wer-compat
Jul 24, 2026
Merged

fix(native): let WER finish native crash reports#1904
jpnurmi merged 3 commits into
masterfrom
jpnurmi/fix/wer-compat

Conversation

@jpnurmi

@jpnurmi jpnurmi commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

The native WER runtime exception callback previously terminated the crashed process after signaling the native daemon. That made sense for the original WER capture path: once the callback claimed ownership and the daemon had been notified, terminating the process ensured the crash was finalized even when the crashed thread did not return normally.

However, terminating from the callback prevents WER from completing its normal report generation. In particular, Report.wer can be written without custom metadata registered by the crashed process, so Sentry's WER integration tags are missing from native fast-fail reports.

Keep claiming ownership and keep waiting for daemon processing, but return control to WER afterwards. This lets WER complete the report, including registered custom metadata, while the native daemon still captures and uploads the Sentry crash event.

Add test_wer_compatibility documenting which backends allow WER to see SEH and fast-fail crashes alongside Sentry capture:

>pytest --with_wer -k wer -v tests\
...
tests/test_integration_crashpad.py::test_crashpad_wer_crash[run_args0] PASSED
tests/test_integration_crashpad.py::test_crashpad_wer_crash[run_args1] PASSED
tests/test_integration_crashpad.py::test_crashpad_wer_crash[run_args2] PASSED
tests/test_integration_crashpad.py::test_crashpad_wer_crash[run_args3] PASSED
tests/test_integration_crashpad.py::test_crashpad_wer_crash[run_args4] PASSED
tests/test_integration_crashpad.py::test_crashpad_wer_crash[run_args5] PASSED
tests/test_integration_crashpad.py::test_crashpad_external_crash_reporter_wer[run_args0] PASSED
tests/test_integration_native.py::test_native_wer_crash[fastfail] PASSED
tests/test_integration_native.py::test_native_wer_crash[stack-buffer-overrun] PASSED
tests/test_integration_screenshot.py::test_capture_screenshot_crashpad_wer[run_args0] PASSED
tests/test_integration_wer.py::test_wer_custom_metadata[none] PASSED
tests/test_integration_wer.py::test_wer_custom_metadata[inproc] PASSED
tests/test_integration_wer.py::test_wer_custom_metadata[breakpad] XFAIL (breakpad swallows SEH exceptions)
tests/test_integration_wer.py::test_wer_custom_metadata[crashpad] XFAIL (crashpad terminates the process)
tests/test_integration_wer.py::test_wer_custom_metadata[native] PASSED
tests/test_integration_wer.py::test_wer_compatibility[inproc-crash] PASSED
tests/test_integration_wer.py::test_wer_compatibility[inproc-fastfail] XFAIL (inproc does not capture WER exceptions)
tests/test_integration_wer.py::test_wer_compatibility[breakpad-crash] XFAIL (breakpad swallows SEH exceptions)
tests/test_integration_wer.py::test_wer_compatibility[breakpad-fastfail] XFAIL (breakpad does not capture WER exceptions)
tests/test_integration_wer.py::test_wer_compatibility[crashpad-crash] XFAIL (crashpad terminates the process)
tests/test_integration_wer.py::test_wer_compatibility[crashpad-fastfail] XFAIL (crashpad terminates the process)
tests/test_integration_wer.py::test_wer_compatibility[native-crash] PASSED
tests/test_integration_wer.py::test_wer_compatibility[native-fastfail] PASSED

The native WER runtime exception callback previously terminated the
crashed process after signaling the native daemon. That made sense for
the original WER capture path: once the callback claimed ownership and
the daemon had been notified, terminating the process ensured the crash
was finalized even when the crashed thread did not return normally.

However, terminating from the callback prevents WER from completing its
normal report generation. In particular, Report.wer can be written
without custom metadata registered by the crashed process, so Sentry's
WER integration tags are missing from native fast-fail reports.

Keep claiming ownership and keep waiting for daemon processing, but
return control to WER afterwards. This lets WER complete the report,
including registered custom metadata, while the native daemon still
captures and uploads the Sentry crash event.

Add WER compatibility coverage documenting which backends allow WER to
see SEH and fast-fail crashes alongside Sentry capture.
Comment thread tests/assertions.py
@codecov

codecov Bot commented Jul 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.77%. Comparing base (b742b8d) to head (f42d01f).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1904   +/-   ##
=======================================
  Coverage   75.76%   75.77%           
=======================================
  Files          92       92           
  Lines       21989    21989           
  Branches     3918     3918           
=======================================
+ Hits        16661    16663    +2     
+ Misses       4447     4444    -3     
- Partials      881      882    +1     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jpnurmi
jpnurmi merged commit 34bad04 into master Jul 24, 2026
137 of 142 checks passed
@jpnurmi
jpnurmi deleted the jpnurmi/fix/wer-compat branch July 24, 2026 15:46
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.

2 participants