Last active
July 30, 2018 12:27
-
-
Save heemskerkerik/f5eb30770a6a8037e70faecce87d181a to your computer and use it in GitHub Desktop.
Test Hang Repro Project
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
<?xml version="1.0" encoding="utf-8"?> | |
<packages> | |
<package id="xunit.runner.console" version="2.4.0" /> | |
<package id="NUnit.ConsoleRunner" version="3.8.0" /> | |
</packages> |
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
#!/usr/bin/env bash | |
nuget restore packages.config -PackagesDirectory ./packages | |
nuget restore TestHang.csproj | |
msbuild /v:q | |
mono ./packages/xunit.runner.console.2.4.0/tools/net462/xunit.console.exe ./bin/Debug/net462/TestHang.dll | |
mono ./packages/NUnit.ConsoleRunner.3.8.0/tools/nunit3-console.exe ./bin/Debug/net462/TestHang.dll |
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
<Project Sdk="Microsoft.NET.Sdk"> | |
<PropertyGroup> | |
<TargetFramework>net462</TargetFramework> | |
</PropertyGroup> | |
<ItemGroup> | |
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0" /> | |
<PackageReference Include="NUnit" Version="3.10.1" /> | |
<PackageReference Include="NUnit3TestAdapter" Version="3.10.0" /> | |
<PackageReference Include="RestSharp" Version="106.2.1" /> | |
<PackageReference Include="xunit" Version="2.3.1" /> | |
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" /> | |
</ItemGroup> | |
</Project> |
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.Collections.Generic; | |
using NUnit.Framework; | |
using RestSharp; | |
using Xunit; | |
namespace TestHang | |
{ | |
public class XunitTest | |
{ | |
[Fact] | |
public void Xunit_Execute_WhenRequestIsPost_DoesNotHang() | |
{ | |
var client = new RestClient("https://httpbin.org/"); | |
var request = new RestRequest("post", Method.POST); | |
request.AddJsonBody( | |
new Dictionary<string, string> | |
{ | |
{ "hello", "world" }, | |
} | |
); | |
client.Execute(request); | |
} | |
} | |
public class NUnitTest | |
{ | |
[Test] | |
public void NUnit_Execute_WhenRequestIsPost_DoesNotHang() | |
{ | |
var client = new RestClient("https://httpbin.org/"); | |
var request = new RestRequest("post", Method.POST); | |
request.AddJsonBody( | |
new Dictionary<string, string> | |
{ | |
{ "hello", "world" }, | |
} | |
); | |
client.Execute(request); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment