Skip to content

Commit a150840

Browse files
e-n-0ddyurchenko
authored andcommitted
[ASM] Fix IAST Grpc DotNet flaky test (#6772)
## Summary of changes Disabling SpanMetaStructs from Agent used in related test and snapshot file. ## Reason for change The test started to be flaky in master. ## 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. -->
1 parent 0491173 commit a150840

File tree

2 files changed

+5
-12
lines changed

2 files changed

+5
-12
lines changed

tracer/test/Datadog.Trace.Security.IntegrationTests/IAST/Grpc/GrpcDotNetTests.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,13 @@ public async Task SubmitsTraces()
4747

4848
const int expectedSpanCount = 24;
4949
const string filename = "Iast.GrpcDotNetTests.BodyPropagation.SubmitsTraces";
50+
51+
// No meta structs support for this test as vulnerabilities can be triggered at the start of the app
52+
// The tracer could possibly not have the time to load the mock agent configuration
5053
using var agent = EnvironmentHelper.GetMockAgent();
54+
agent.Configuration.SpanMetaStructs = false;
5155
using var process = await RunSampleAndWaitForExit(agent);
56+
5257
var spans = agent.WaitForSpans(expectedSpanCount);
5358
var spansFiltered = spans.Where(x => x.Type == SpanTypes.Web).ToList();
5459

tracer/test/snapshots/Iast.GrpcDotNetTests.BodyPropagation.SubmitsTraces.verified.txt

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,6 @@
5555
_dd.top_level: 1.0,
5656
_dd.tracer_kr: 1.0,
5757
_sampling_priority_v1: 2.0
58-
},
59-
MetaStruct: {
60-
iast:
6158
}
6259
},
6360
{
@@ -116,9 +113,6 @@
116113
_dd.top_level: 1.0,
117114
_dd.tracer_kr: 1.0,
118115
_sampling_priority_v1: 2.0
119-
},
120-
MetaStruct: {
121-
iast:
122116
}
123117
},
124118
{
@@ -177,9 +171,6 @@
177171
_dd.top_level: 1.0,
178172
_dd.tracer_kr: 1.0,
179173
_sampling_priority_v1: 2.0
180-
},
181-
MetaStruct: {
182-
iast:
183174
}
184175
},
185176
{
@@ -238,9 +229,6 @@
238229
_dd.top_level: 1.0,
239230
_dd.tracer_kr: 1.0,
240231
_sampling_priority_v1: 2.0
241-
},
242-
MetaStruct: {
243-
iast:
244232
}
245233
}
246234
]

0 commit comments

Comments
 (0)