Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions tests/monotouch-test/System.Net.Http/NSUrlSessionHandlerTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public void DisposeAndRecreateBackgroundSessionHandler ()
Assert.Inconclusive ("First request failed or timed out - cannot verify the bug.");
}

IgnoreIfExceptionDueToBackgroundServiceInUseByAnotherProcess (ex);
TestRuntime.IgnoreInCIIfBadNetwork (ex);
Assert.IsNull (ex, "First request exception");

Expand All @@ -56,8 +57,26 @@ public void DisposeAndRecreateBackgroundSessionHandler ()
Assert.Fail ("Second request timedout - this indicates the bug is present.");
}

IgnoreIfExceptionDueToBackgroundServiceInUseByAnotherProcess (ex);
TestRuntime.IgnoreInCIIfBadNetwork (ex);
Assert.IsNull (ex, "Second request exception");
}

void IgnoreIfExceptionDueToBackgroundServiceInUseByAnotherProcess (Exception? e)
{
if (e is null)
return;

if (e is not HttpRequestException hre)
return;

if (hre.InnerException is not NSErrorException nee)
return;

if (nee.Code != (nint) NSUrlError.BackgroundSessionInUseByAnotherProcess)
return;

Assert.Ignore ("The background service is in use by another process.");
}
}
}
Loading