Skip to content

test: Use atomic coverage counters - #9860

Open
denrase wants to merge 2 commits into
mainfrom
denrase/test/atomic-coverage-counters
Open

denrase wants to merge 2 commits into
mainfrom
denrase/test/atomic-coverage-counters

Conversation

@denrase

@denrase denrase commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator

📜 Description

Stack 1/2: targets main; followed by #9670 (native coverage attribution).

Enable atomic profiling counters in the opt-in SwiftPM test configuration:

  • Clang/C++: -fprofile-update=atomic.
  • Swift: -Xllvm -instrprof-atomic-counter-update-all.
  • Scope both settings to Sentry-owned package targets and preserve inherited settings. External dependencies and consumer builds retain their settings.

This PR changes only Tests/Configuration/SwiftPM.xcconfig and the corresponding documentation bullet. The native reporting/metadata changes and their tooling tests remain in #9670.

💡 Motivation and Context

Part of #9651. Non-atomic profiling increments can lose updates during concurrent SDK work, even when XCTest itself runs serially. This affects coverage measurements; it is not evidence of an SDK data race.

#skip-changelog — test infrastructure only; no shipped SDK behavior or public API changes.

💚 How did you test it?

On this isolated base branch, using Xcode 27.2 (27B52):

  • Fresh package build and macOS SentryIdTests: 14/14 passed, without the downstream metadata changes.
  • Audited actual compile/scan commands, expanding response files: 550 Sentry commands had atomic profiling; 183 KSCrash commands did not.
  • make format, make analyze, and diff checks passed.

Earlier investigation also reproduced lost increments with non-atomic counters and exact counts with atomic counters. That historical probe was not rerun for this split.

Pending: supported-toolchain CI, particularly Xcode 26 and the internal Swift LLVM option. Xcode 26 is not installed locally.

📝 Checklist

  • I added tests to verify the changes. (Existing tests and compiler-command audits were used; no new test source in this PR.)
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed. (Not applicable.)
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.
  • Public API changes (sdk_api.json, sdk_api_objc.json) reviewed by another Mobile SDK team member or implemented according to the develop docs spec. (Not applicable.)
  • If I added a new public API, I also added it to the SentryObjC wrapper. (Not applicable.)

Use atomic Clang, C++, and Swift profiling updates for Sentry-owned
package test targets. Preserve inherited settings and leave external
dependencies and consumer builds unchanged.
@denrase denrase self-assigned this Dec 1, 2026
@github-actions github-actions Bot added the risk: medium PR risk score: medium label Dec 1, 2026
@github-actions

github-actions Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

PR risk: medium

For commit 2235ad0.

The model rated this change low. It was raised to medium because:

  • R7: the model was not confident enough that the change is low

This label is a hint for reviewers, not an approval.

@denrase denrase mentioned this pull request Dec 1, 2026
5 of 9 tasks
@denrase
denrase marked this pull request as ready for review December 1, 2026 10:32
@denrase
denrase requested review from a team, donnywals and noahsmartin as code owners December 1, 2026 10:32
@denrase
denrase requested review from itaybre and philprime and removed request for a team December 1, 2026 10:32
@denrase denrase added the run-full-ci Allows gated GitHub Action workflows to run for a labelled pull request label Dec 1, 2026
@github-actions github-actions Bot added risk: medium PR risk score: medium and removed risk: medium PR risk score: medium labels Dec 1, 2026
@denrase
denrase added this pull request to stack #9862 December 1, 2026 10:37

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved risk: medium PR risk score: medium run-full-ci Allows gated GitHub Action workflows to run for a labelled pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants