This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class _ExhaustTest : IDisposable | |
{ | |
public const int ListenerCount = 1000; | |
public const int ConnectCount = 1024 * 20; | |
//public const int ConnectCount = 10; | |
private readonly ITestOutputHelper _output; | |
private Task[] _listenTasks = new Task[ListenerCount]; | |
private Socket[] _listeners = new Socket[ListenerCount]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2021-03-18T15:01:04.4504783Z client_1 | System.Net.Http.HttpRequestException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. (server:5001) | |
2021-03-18T15:01:04.4506315Z | |
2021-03-18T15:01:04.4508672Z client_1 | ---> System.Net.Sockets.SocketException (10060): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. | |
2021-03-18T15:01:04.4509920Z | |
2021-03-18T15:01:04.4511533Z client_1 | at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken) in /_/src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.Tasks.cs:line 1233 | |
2021-03-18T15:01:04.4512995Z | |
2021-03-18T15:01:04.4514290Z client_1 | at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void TransformImage(ImageEditModel imageEdit, MemoryStream destinationStream) | |
{ | |
if (destinationStream == null) | |
{ | |
throw new ArgumentNullException(nameof(destinationStream)); | |
} | |
var sourceImage = Image.Load(imageEdit.SourceStream); | |
var blur = imageEdit.History.Where(h => h.Tool == ImageTool.Blur).FirstOrDefault(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using SixLabors.Fonts; | |
using SixLabors.ImageSharp; | |
using SixLabors.ImageSharp.Processing; | |
using SixLabors.ImageSharp.Drawing.Processing; | |
using System; | |
using SixLabors.ImageSharp.PixelFormats; | |
namespace ColonTest | |
{ | |
class Program |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html xmlns:tp="http://schemas.datacontract.org/2004/07/Microsoft.VisualStudio.TestPlatform.Extensions.HtmlLogger.ObjectModel" xmlns:a="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns:msxsl="urn:schemas-microsoft-com:xslt"> | |
<body> | |
<h1>Test run details</h1> | |
<div class="summary"> | |
<div class="block"><span>Total tests</span><div class="total-tests">1182</div><br></div> | |
<div class="block"><span>Passed : </span><span class="passedTests">1153</span><br><span>Failed : </span><span class="failedTests">9</span><br><span>Skipped : </span><span class="skippedTests">20</span><br></div> | |
<div class="block"><span>Pass percentage</span><div class="pass-percentage">97 %</div><br></div> | |
<div class="block"><span>Run duration</span><div class="test-run-time">43s 95ms</div><br></div><br></div> | |
<h2>Failed Results</h2> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ConditionalFact(nameof(OsSupportsWinHttpTrailingHeaders))] | |
public async Task Http2GetAsyncResponseHeadersReadOption_RemoteServer_TrailingHeaders_Available() | |
{ | |
Uri address = new Uri("https://localhost:5001/trailers.ashx"); | |
using (HttpClient client = CreateHttpClient()) | |
{ | |
Task<HttpResponseMessage> sendTask = client.GetAsync(address, HttpCompletionOption.ResponseHeadersRead); | |
HttpResponseMessage response = await sendTask; | |
Assert.Equal(HttpStatusCode.OK, response.StatusCode); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The workaround is utilizing ConnectCallback, which is a .NET 5+ feature. | |
// For more info see: | |
// https://devblogs.microsoft.com/dotnet/net-5-new-networking-improvements/#socketshttphandler-extension-points | |
public HttpClient CreateHttpClientWithReusePort() | |
{ | |
SocketsHttpHandler handler = new SocketsHttpHandler | |
{ | |
ConnectCallback = ReusePortConnectAsync | |
}; | |
return new HttpClient(handler); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Console log: 'System.Net.Sockets.Tests' from job 93f31455-92dc-4293-9906-96117cc681c8 workitem ce7ce536-f347-49cb-b6f2-f083b0982a70 (osx.1015.amd64.open) executed on machine dci-macpro-09.local | |
+ ./RunTests.sh --runtime-path /tmp/helix/working/993B086D/p | |
----- start Thu Jan 21 09:13:50 PST 2021 =============== To repro directly: ===================================================== | |
pushd . | |
/tmp/helix/working/993B086D/p/dotnet exec --runtimeconfig System.Net.Sockets.Tests.runtimeconfig.json --depsfile System.Net.Sockets.Tests.deps.json xunit.console.dll System.Net.Sockets.Tests.dll -xml testResults.xml -nologo -nocolor -notrait category=IgnoreForCI -notrait category=OuterLoop -notrait category=failing | |
popd | |
=========================================================================================================== | |
/private/tmp/helix/working/993B086D/w/B692097E/e /private/tmp/helix/working/993B086D/w/B692097E/e | |
Discovering: System.Net.Sockets.Tests (method display = ClassAndMethod, method display options = Non |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using System.Net; | |
using System.Net.Sockets; | |
namespace HangSockets | |
{ | |
class Program | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdio> | |
#include <sys/socket.h> | |
#include <netinet/in.h> | |
#include <arpa/inet.h> | |
#include <pthread.h> | |
#include <unistd.h> | |
#include <stdio.h> | |
#include <assert.h> |