Skip to content

Commit 15ff893

Browse files
committed
fix security integration test
1 parent 38627f7 commit 15ff893

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

tracer/test/Datadog.Trace.Security.IntegrationTests/AspNetWebApi.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,10 @@ public async Task TestBlockedRequest(string test)
105105

106106
var settings = VerifyHelper.GetSpanVerifierSettings(test);
107107
FilterConnectionHeader(settings);
108-
await TestAppSecRequestWithVerifyAsync(_iisFixture.Agent, url, null, 5, 1, settings, userAgent: "Hello/V");
108+
// When AppSec is enabled, the request is blocked early and only the ASP.NET root span is created.
109+
// When AppSec is disabled, the request completes normally and we also get the Web API span.
110+
var spansPerRequest = SecurityEnabled ? 1 : 2;
111+
await TestAppSecRequestWithVerifyAsync(_iisFixture.Agent, url, null, 5, spansPerRequest, settings, userAgent: "Hello/V");
109112
}
110113

111114
[Trait("Category", "EndToEnd")]

0 commit comments

Comments
 (0)