Skip to content

Commit

Permalink
Owin tests - nullable
Browse files Browse the repository at this point in the history
  • Loading branch information
Kielek committed Mar 5, 2024
1 parent a29a269 commit 6a7903f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace OpenTelemetry.Instrumentation.Owin.Tests.Controllers;
public class TestController : ApiController
{
// GET api/test/{id}
public string Get(string id = null)
public string Get(string? id = null)
{
return $"id:{id}";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,18 @@ namespace OpenTelemetry.Instrumentation.Owin.Tests;
public class DiagnosticsMiddlewareTests : IDisposable
{
private readonly Uri serviceBaseUri;
private readonly IDisposable listener;
private readonly IDisposable? listener;
private readonly EventWaitHandle requestCompleteHandle = new(false, EventResetMode.AutoReset);

public DiagnosticsMiddlewareTests()
{
Random random = new Random();
var retryCount = 5;
while (retryCount > 0)
do
{
this.serviceBaseUri = new Uri($"http://localhost:{random.Next(2000, 5000)}/");
try
{
this.serviceBaseUri = new Uri($"http://localhost:{random.Next(2000, 5000)}/");

this.listener = WebApp.Start(
this.serviceBaseUri.ToString(),
appBuilder =>
Expand Down Expand Up @@ -81,6 +80,7 @@ public DiagnosticsMiddlewareTests()
retryCount--;
}
}
while (retryCount > 0);

if (this.listener == null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<PropertyGroup>
<Description>Unit test project for OpenTelemetry OWIN instrumentation</Description>
<TargetFrameworks>$(NetFrameworkMinimumSupportedVersion)</TargetFrameworks>
<Nullable>disable</Nullable>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 6a7903f

Please sign in to comment.