Skip to content

[dotnet] scrub empty static field#7198

Open
dudikeleti wants to merge 5 commits into
mainfrom
dudik/dotnet/scrub-empty-static-field
Open

[dotnet] scrub empty static field#7198
dudikeleti wants to merge 5 commits into
mainfrom
dudik/dotnet/scrub-empty-static-field

Conversation

@dudikeleti

Copy link
Copy Markdown
Contributor

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 the exception_replay_multiframe approval unstable while the tracer-side static field guard is not yet on master.

Changes

Normalize .NET exception replay snapshot approvals by scrubbing incidental staticFields.Empty from received and expected snapshot data before comparison.

Temporarily marks the .NET test_exception_replay_multiframe system test as missing_feature in manifests/dotnet.yml until 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

  1. ⚠️ Create your PR as draft ⚠️
  2. Work on you PR until the CI passes
  3. Mark it as ready for review
    • Test logic is modified? -> Get a review from RFC owner.
    • Framework is modified, or non obvious usage of it -> get a review from R&P team

🚀 Once your PR is reviewed and the CI green, you can merge it!

🛟 #apm-shared-testing 🛟

Reviewer checklist

  • Anything but tests/ or manifests/ is modified ? I have the approval from R&P team
  • A docker base image is modified?
    • the relevant build-XXX-image label is present
  • A scenario is added, removed or renamed?

@github-actions

Copy link
Copy Markdown
Contributor

CODEOWNERS have been resolved as:

manifests/dotnet.yml                                                    @DataDog/apm-dotnet @DataDog/asm-dotnet
tests/debugger/test_debugger_exception_replay.py                        @DataDog/debugger @DataDog/system-tests-core

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 drop staticFields entirely when it becomes empty).
  • Apply the same scrubbing to stored expected snapshots for .NET before comparing to received snapshots.
  • Mark test_exception_replay_multiframe as missing_feature in manifests/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.

Comment thread tests/debugger/test_debugger_exception_replay.py
@datadog-system-tests-org

datadog-system-tests-org Bot commented Jun 22, 2026

Copy link
Copy Markdown

Pipelines

⚠️ Warnings

🚦 5 Pipeline jobs failed

Testing the test | System Tests (dotnet, dev) / End-to-end #1 / poc 1   View in Datadog   GitHub Actions

Testing the test | System Tests (dotnet, dev) / End-to-end #1 / uds 1   View in Datadog   GitHub Actions

Testing the test | System Tests (dotnet, prod) / End-to-end #1 / poc 1   View in Datadog   GitHub Actions

View all 5 failed jobs.

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: a5bdf6b | Docs | Give us feedback!

@datadog-datadog-prod-us1-2

datadog-datadog-prod-us1-2 Bot commented Jun 22, 2026

Copy link
Copy Markdown

Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 41a15a4 | Docs | Datadog PR Page | Give us feedback!

@dudikeleti dudikeleti changed the title Dudik/dotnet/scrub empty static field [dotnet] scrub empty static field Jun 22, 2026
@dudikeleti dudikeleti force-pushed the dudik/dotnet/scrub-empty-static-field branch from 90bfebf to 41a15a4 Compare June 23, 2026 12:21
@dudikeleti dudikeleti marked this pull request as ready for review June 23, 2026 12:23
@dudikeleti dudikeleti requested review from a team as code owners June 23, 2026 12:23

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +260 to +262
function = entry.get("function")
if function is None:
continue

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 nccatoni left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (for @DataDog/system-tests-core) but you should get a review from someone familiar with the feature

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.

3 participants