test: Fix flaky test_external_crash_reporter_http when running with kcov#1419
Merged
test: Fix flaky test_external_crash_reporter_http when running with kcov#1419
Conversation
Co-authored-by: vaind <[email protected]>
Copilot
AI
changed the title
[WIP] Fix flaky behavior in external crash reporter HTTP test
Fix flaky test_external_crash_reporter_http when running with kcov
Oct 17, 2025
Contributor
|
@copilot we should just skip the whole test case in kcov then |
… assertions Co-authored-by: vaind <[email protected]>
Contributor
Author
Copilot
AI
changed the title
test: Fix flaky test_external_crash_reporter_http when running with kcov
Fix flaky test_external_crash_reporter_http when running with kcov
Oct 17, 2025
Contributor
|
@copilot we only care about test_external_crash_reporter_http - the rest works even with kcov right? |
Co-authored-by: vaind <[email protected]>
Contributor
Author
vaind
reviewed
Oct 18, 2025
vaind
approved these changes
Oct 19, 2025
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.
Problem
The
test_external_crash_reporter_httptest was flaky when running under kcov code coverage analysis. The issue is that kcov exits with code 0 even when the process it's monitoring crashes with a signal like SIGSEGV:This caused the assertion
assert child.returncodeto fail because 0 is falsy in Python, making the test fail intermittently when running in the kcov CI job.Solution
Skip the
test_external_crash_reporter_httptest when running under kcov using the@pytest.mark.skipifdecorator. The fix uses the existingis_kcovcondition variable fromtests/conditions.py:This approach is consistent with how other analyzer-specific behaviors are handled in the codebase (e.g.,
has_breakpadandhas_crashpadalready skip tests entirely when kcov is running).Tests Updated
Only
test_external_crash_reporter_httpis skipped when running with kcov. Other inproc crash tests work correctly with kcov and do not need to be skipped.Note: Breakpad and Crashpad tests are already completely skipped when kcov is running via the
has_breakpadandhas_crashpadconditions, so they don't require updates.Fixes https://github.com/getsentry/sentry-native/actions/runs/18502219462/attempts/1 and https://github.com/getsentry/sentry-native/actions/runs/18594256344/job/53016350698
cc @jpnurmi
Fixes #1418
Original prompt
Fixes #1418
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.