[dotnet] scrub empty static field#7198
Conversation
|
|
There was a problem hiding this comment.
Pull request overview
This PR aims to stabilize .NET debugger exception replay snapshot approvals by normalizing away incidental framework staticFields.Empty differences during approval comparison, and temporarily deactivating the .NET test_exception_replay_multiframe system test via the manifest until the tracer-side static-field guard is available.
Changes:
- Extend .NET snapshot scrubbing to remove
staticFields.Empty(and dropstaticFieldsentirely when it becomes empty). - Apply the same scrubbing to stored expected snapshots for .NET before comparing to received snapshots.
- Mark
test_exception_replay_multiframeasmissing_featureinmanifests/dotnet.yml.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tests/debugger/test_debugger_exception_replay.py | Adds .NET-specific snapshot normalization to scrub staticFields.Empty and aligns expected snapshot scrubbing with received snapshot scrubbing. |
| manifests/dotnet.yml | Temporarily disables the .NET multiframe exception replay test as missing_feature. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
🎉 All green!🧪 All tests passed 🔗 Commit SHA: 41a15a4 | Docs | Datadog PR Page | Give us feedback! |
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
90bfebf to
41a15a4
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 41a15a448a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| function = entry.get("function") | ||
| if function is None: | ||
| continue |
There was a problem hiding this comment.
Preserve validation for malformed .NET stack frames
When a received .NET snapshot contains a stack entry without function, this now silently drops the frame before comparing to the approval. The no-function case that needs to be tolerated is the test-injected {"<runtime>": "<scrubbed>"} sentinel when re-scrubbing expected approvals; applying the same skip to raw received data can hide malformed debugger stack frames instead of failing the system test.
Useful? React with 👍 / 👎.
nccatoni
left a comment
There was a problem hiding this comment.
LGTM (for @DataDog/system-tests-core) but you should get a review from someone familiar with the feature
Motivation
The .NET tracer is changing exception replay snapshot capture so static fields that may trigger type initializers are no longer captured. Current dotnet master still emits incidental framework static fields, such as
EmptyResult.Empty, which makes theexception_replay_multiframeapproval unstable while the tracer-side static field guard is not yet on master.Changes
Normalize .NET exception replay snapshot approvals by scrubbing incidental
staticFields.Emptyfrom received and expected snapshot data before comparison.Temporarily marks the .NET
test_exception_replay_multiframesystem test asmissing_featureinmanifests/dotnet.ymluntil dotnet tracer master includes the static field guard. Once that tracer change lands on master, this manifest entry should be removed to re-enable the test.Workflow
🚀 Once your PR is reviewed and the CI green, you can merge it!
🛟 #apm-shared-testing 🛟
Reviewer checklist
tests/ormanifests/is modified ? I have the approval from R&P teambuild-XXX-imagelabel is present