Skip to content

Commit 4134da7

Browse files
authored
Add integration test for case apms19196 (#8438)
## Summary of changes This reproduces the crash [described in this README](https://github.com/DataDog/dd-trace-dotnet/blob/82cc4cf0e29478fd2fdc41afdf764a2abf662199/repro/APMS-19196/README.md) on linux x64 arch. Aim is to merge to #8428 First tested it's crashing on master <img width="2830" height="851" alt="image" src="https://github.com/user-attachments/assets/96e882fa-308e-44b6-8116-c93c7d5b7bb2" /> ## Reason for change ## Implementation details ## Test coverage ## Other details <!-- Fixes #{issue} --> <!-- ⚠️ Note: Where possible, please obtain 2 approvals prior to merging. Unless CODEOWNERS specifies otherwise, for external teams it is typically best to have one review from a team member, and one review from apm-dotnet. Trivial changes do not require 2 reviews. MergeQueue is NOT enabled in this repository. If you have write access to the repo, the PR has 1-2 approvals (see above), and all of the required checks have passed, you can use the Squash and Merge button to merge the PR. If you don't have write access, or you need help, reach out in the #apm-dotnet channel in Slack. -->
1 parent 365c054 commit 4134da7

14 files changed

+272
-6
lines changed

tracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/TraceAnnotationsTests.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ protected TraceAnnotationsTests(string sampleAppName, bool enableTelemetry, ITes
7878
[SkippableFact]
7979
public async Task SubmitTraces()
8080
{
81-
const int expectedSpanCount = 51;
81+
const int expectedSpanCount = 52;
8282
var ddTraceMethodsString = string.Empty;
8383

8484
foreach (var type in TestTypes)
@@ -88,6 +88,10 @@ public async Task SubmitTraces()
8888

8989
ddTraceMethodsString += ";Samples.TraceAnnotations.ExtensionMethods[ExtensionMethodForTestType,ExtensionMethodForTestTypeGeneric,ExtensionMethodForTestTypeTypeStruct];System.Net.Http.HttpRequestMessage[set_Method]";
9090

91+
// Add method with extreme exception handling nesting (APMS-19196 regression test)
92+
// Must target the sync method which has the EH directly in its body (not in an async state machine)
93+
ddTraceMethodsString += ";Samples.TraceAnnotations.ExtremeExceptionHandling[DeepNestedExceptionHandlingSync]";
94+
9195
SetEnvironmentVariable("DD_TRACE_METHODS", ddTraceMethodsString);
9296
// Don't bother with telemetry in version mismatch scenarios because older versions may only support V1 telemetry
9397
// which we no longer support in our mock telemetry agent

tracer/test/snapshots/TraceAnnotationsAutomaticOnlyTests._.Core.verified.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -844,5 +844,19 @@
844844
language: dotnet,
845845
version: 1.0.0
846846
}
847+
},
848+
{
849+
TraceId: Id_1,
850+
SpanId: Id_62,
851+
Name: trace.annotation,
852+
Resource: ExtremeExceptionHandling.DeepNestedExceptionHandlingSync,
853+
Service: Samples.TraceAnnotations,
854+
ParentId: Id_2,
855+
Tags: {
856+
component: trace,
857+
env: integration_tests,
858+
language: dotnet,
859+
version: 1.0.0
860+
}
847861
}
848862
]

tracer/test/snapshots/TraceAnnotationsAutomaticOnlyTests._.DotNet.verified.txt

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[
1+
[
22
{
33
TraceId: Id_1,
44
SpanId: Id_2,
@@ -844,5 +844,19 @@
844844
language: dotnet,
845845
version: 1.0.0
846846
}
847+
},
848+
{
849+
TraceId: Id_1,
850+
SpanId: Id_62,
851+
Name: trace.annotation,
852+
Resource: ExtremeExceptionHandling.DeepNestedExceptionHandlingSync,
853+
Service: Samples.TraceAnnotations,
854+
ParentId: Id_2,
855+
Tags: {
856+
component: trace,
857+
env: integration_tests,
858+
language: dotnet,
859+
version: 1.0.0
860+
}
847861
}
848862
]

tracer/test/snapshots/TraceAnnotationsAutomaticOnlyTests._.Net.verified.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -844,5 +844,19 @@
844844
language: dotnet,
845845
version: 1.0.0
846846
}
847+
},
848+
{
849+
TraceId: Id_1,
850+
SpanId: Id_62,
851+
Name: trace.annotation,
852+
Resource: ExtremeExceptionHandling.DeepNestedExceptionHandlingSync,
853+
Service: Samples.TraceAnnotations,
854+
ParentId: Id_2,
855+
Tags: {
856+
component: trace,
857+
env: integration_tests,
858+
language: dotnet,
859+
version: 1.0.0
860+
}
847861
}
848862
]

tracer/test/snapshots/TraceAnnotationsVersionMismatchAfterFeatureTests._.Core.verified.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -844,5 +844,19 @@
844844
language: dotnet,
845845
version: 1.0.0
846846
}
847+
},
848+
{
849+
TraceId: Id_1,
850+
SpanId: Id_62,
851+
Name: trace.annotation,
852+
Resource: ExtremeExceptionHandling.DeepNestedExceptionHandlingSync,
853+
Service: Samples.TraceAnnotations.VersionMismatch.AfterFeature,
854+
ParentId: Id_2,
855+
Tags: {
856+
component: trace,
857+
env: integration_tests,
858+
language: dotnet,
859+
version: 1.0.0
860+
}
847861
}
848862
]

tracer/test/snapshots/TraceAnnotationsVersionMismatchAfterFeatureTests._.DotNet.verified.txt

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[
1+
[
22
{
33
TraceId: Id_1,
44
SpanId: Id_2,
@@ -844,5 +844,19 @@
844844
language: dotnet,
845845
version: 1.0.0
846846
}
847+
},
848+
{
849+
TraceId: Id_1,
850+
SpanId: Id_62,
851+
Name: trace.annotation,
852+
Resource: ExtremeExceptionHandling.DeepNestedExceptionHandlingSync,
853+
Service: Samples.TraceAnnotations.VersionMismatch.AfterFeature,
854+
ParentId: Id_2,
855+
Tags: {
856+
component: trace,
857+
env: integration_tests,
858+
language: dotnet,
859+
version: 1.0.0
860+
}
847861
}
848862
]

tracer/test/snapshots/TraceAnnotationsVersionMismatchAfterFeatureTests._.Net.verified.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -844,5 +844,19 @@
844844
language: dotnet,
845845
version: 1.0.0
846846
}
847+
},
848+
{
849+
TraceId: Id_1,
850+
SpanId: Id_62,
851+
Name: trace.annotation,
852+
Resource: ExtremeExceptionHandling.DeepNestedExceptionHandlingSync,
853+
Service: Samples.TraceAnnotations.VersionMismatch.AfterFeature,
854+
ParentId: Id_2,
855+
Tags: {
856+
component: trace,
857+
env: integration_tests,
858+
language: dotnet,
859+
version: 1.0.0
860+
}
847861
}
848862
]

tracer/test/snapshots/TraceAnnotationsVersionMismatchBeforeFeatureTests._.Core.verified.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -844,5 +844,19 @@
844844
language: dotnet,
845845
version: 1.0.0
846846
}
847+
},
848+
{
849+
TraceId: Id_1,
850+
SpanId: Id_62,
851+
Name: trace.annotation,
852+
Resource: ExtremeExceptionHandling.DeepNestedExceptionHandlingSync,
853+
Service: Samples.TraceAnnotations.VersionMismatch.BeforeFeature,
854+
ParentId: Id_2,
855+
Tags: {
856+
component: trace,
857+
env: integration_tests,
858+
language: dotnet,
859+
version: 1.0.0
860+
}
847861
}
848862
]

tracer/test/snapshots/TraceAnnotationsVersionMismatchBeforeFeatureTests._.DotNet.verified.txt

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[
1+
[
22
{
33
TraceId: Id_1,
44
SpanId: Id_2,
@@ -844,5 +844,19 @@
844844
language: dotnet,
845845
version: 1.0.0
846846
}
847+
},
848+
{
849+
TraceId: Id_1,
850+
SpanId: Id_62,
851+
Name: trace.annotation,
852+
Resource: ExtremeExceptionHandling.DeepNestedExceptionHandlingSync,
853+
Service: Samples.TraceAnnotations.VersionMismatch.BeforeFeature,
854+
ParentId: Id_2,
855+
Tags: {
856+
component: trace,
857+
env: integration_tests,
858+
language: dotnet,
859+
version: 1.0.0
860+
}
847861
}
848862
]

tracer/test/snapshots/TraceAnnotationsVersionMismatchBeforeFeatureTests._.Net.verified.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -844,5 +844,19 @@
844844
language: dotnet,
845845
version: 1.0.0
846846
}
847+
},
848+
{
849+
TraceId: Id_1,
850+
SpanId: Id_62,
851+
Name: trace.annotation,
852+
Resource: ExtremeExceptionHandling.DeepNestedExceptionHandlingSync,
853+
Service: Samples.TraceAnnotations.VersionMismatch.BeforeFeature,
854+
ParentId: Id_2,
855+
Tags: {
856+
component: trace,
857+
env: integration_tests,
858+
language: dotnet,
859+
version: 1.0.0
860+
}
847861
}
848862
]

0 commit comments

Comments
 (0)