Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception when running tests on https://github.com/aspnet/KestrelHttpServer #710

Closed
davidfowl opened this issue Apr 13, 2017 · 9 comments

Comments

@davidfowl
Copy link

We recently got a new .NET Core 2.0 SDK and now our command line test runs on .NET Framework sometimes fail like this:

Test run for C:\dev\git\Universe\KestrelHttpServer\test\Microsoft.AspNetCore.Server.Kestrel.Core.Tests\bin\Debug\net46\Microsoft.AspNetCore.Server.Kestrel.Core.Tests.exe(.NETFramework,Version=v4.6)
Microsoft (R) Test Execution Command Line Tool Version 15.0.0.0
Copyright (c) Microsoft Corporation.  All rights reserved.

Starting test execution, please wait...
[xUnit.net 00:00:03.6031625]   Discovering: Microsoft.AspNetCore.Server.Kestrel.Core.Tests
[xUnit.net 00:00:14.7044110]   Discovered:  Microsoft.AspNetCore.Server.Kestrel.Core.Tests
[xUnit.net 00:00:22.5590072]   Starting:    Microsoft.AspNetCore.Server.Kestrel.Core.Tests

Unhandled Exception: System.ArgumentException: The parameter cannot be null or empty.
Parameter name: message
   at Microsoft.VisualStudio.TestPlatform.Common.Logging.TestSessionMessageLogger.SendMessage(TestMessageLevel testMessageLevel, String message)
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Hosting.DefaultTestHostManager.<get_ErrorReceivedCallback>b__25_0(Process process, String data)
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Helpers.ProcessHelper.<>c__DisplayClass0_0.<LaunchProcess>b__0(Object sender, DataReceivedEventArgs args)
   at System.Diagnostics.Process.ErrorReadNotifyUser(String data)
   at System.Diagnostics.AsyncStreamReader.FlushMessageQueue(Boolean rethrowInNewThread)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Diagnostics.AsyncStreamReader.<>c.<FlushMessageQueue>b__17_0(Object edi)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadPoolWorkQueue.Dispatch()

Steps to reproduce

Expected behavior

Don't crash

Actual behavior

it crashes

Environment

dotnet --info

.NET Command Line Tools (2.0.0-preview1-005783)

Product Information:
 Version:            2.0.0-preview1-005783
 Commit SHA-1 hash:  8bd15c7ec0

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.10586
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Users\dfowler\AppData\Local\Microsoft\dotnet\sdk\2.0.0-preview1-005783\

Microsoft .NET Core Shared Framework Host

  Version  : 2.0.0-preview1-001967-00
  Build    : fa25acec41a87ce36b3ea61273d4798eb0a2486f
@smadala smadala added the bug label Apr 13, 2017
@smadala
Copy link
Contributor

smadala commented Apr 13, 2017

This has been fixed in other changes: d189e71#diff-3704124f8a6986a28c2903753d3f9f07L74.
Will close once it released.

@mikeharder
Copy link

This is blocking ASP.NET builds. How can we get a fix or workaround ASAP?

@mikeharder
Copy link

Something in our tests must have been triggering this issue. Now that our tests are fixed this issue is no longer blocking us.

@mikeharder
Copy link

Actually, this is still a blocking issue for ASP.NET. We just saw this failure in two different test projects where no tests should be failing (and passed on the subsequent build).

@davidfowl
Copy link
Author

@smadala Can you articulate what was fixed, what component it is in and if you have a myget feed with those changes?

@smadala
Copy link
Contributor

smadala commented Apr 14, 2017

This issue occurs when test/testhost (full framework) try to write empty line to standard error stream. Passing empty message to TestSessionMessageLogger.SendMessage() got fixed here.
Fix is in Microsoft.TestPlatform.CLI nuget package that ships with dotnet/cli.

To consume latest Microsoft.TestPlatform.CLI 15.1.0-preview-20170414-03. Use feed source https://dotnet.myget.org/F/vstest/api/v3/index.json.

Use following command for using latest vstest :
dotnet test -p:"VSTestConsolePath=<path_to>\Microsoft.TestPlatform.CLI.15.1.0-preview-20170414-03\contentFiles\any\netcoreapp2.0\vstest.console.dll"

We are planning to insert this change to dotnet/cli today.

@sbaid
Copy link
Contributor

sbaid commented Apr 19, 2017

PR is pending merge. Fix should be there in the following CLI build.

@sbaid
Copy link
Contributor

sbaid commented Apr 20, 2017

@smadala pl verify and close this on latest CLI build

@smadala
Copy link
Contributor

smadala commented Apr 20, 2017

Verified on cli build: 2.0.0-preview1-005825

@smadala smadala closed this as completed Apr 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants