dotnet-installer/test/Microsoft.DotNet.Tools.Tests.Utilities/Commands
Piotr Puszkiewicz caad95491a Fix output race (#4911)
* Fix output race

TestCommand starts the test process before wiring up stderr & stdout. This change delays process start until after the wireup is finished so that the test process cannot shut down before we have wired up output redirection.

* Bypass stream forwarder when it fails to attach to a process

CLI has tests failing errenously when, due to timing issues, the StreamForwarders fail to attach to a process because it managed to exit before attachment occurs. 

We tried attaching the forwarders prior to Process Start but this proved impossible because the OUT and ERR streams are not available to attach before the process starts. 

This exposes a fundamental flaw in our output redirection mechanisms. We should probably move to using https://msdn.microsoft.com/en-us/library/system.diagnostics.process.outputdatareceived.aspx or a similar mechanism. However, I don't know that @brthor hadn't considered and discarded this approach.

For the time being I am attempting to make tests more deterministic by capturing the associated exceptions and moving to a different mechanism when StreamForwarders are not available.

Opened https://github.com/dotnet/cli/issues/4913 to track the broader issue.

* File.Copy is not atomic...
2016-12-04 11:54:29 -08:00
..
AddP2PCommand.cs Strings->LocalizableStrings, Extensions->ProjectRootElementExtensions, fix long lines, remove empty line 2016-11-23 15:35:48 -08:00
BuildCommand.cs [WIP] Removes *3 verbs, making msbuild the driver (#4456) 2016-10-27 18:46:43 -07:00
BuildPJCommand.cs binding redirects tests: Simplify and get ready for enabling (#4692) 2016-11-14 14:26:03 -08:00
CleanCommand.cs Migrating all test projects (#4668) 2016-11-11 21:46:29 -10:00
DependencyToolInvokerCommand.cs [WIP] Removes *3 verbs, making msbuild the driver (#4456) 2016-10-27 18:46:43 -07:00
DotnetCommand.cs Add kestrel tests. 2016-04-04 17:57:12 -07:00
DotnetTestCommand.cs Updating the Microsoft.Net.Sdk & Microsoft.Net.Sdk.Web versions (#4585) 2016-11-03 22:12:33 -07:00
HelpCommand.cs Move the help command it it's own class. 2016-02-15 20:11:02 -08:00
MigrateCommand.cs post migration cleanup (#4449) 2016-10-29 01:58:37 -07:00
MSBuildCommand.cs Add dotnet msbuild tests. 2016-09-22 15:56:36 -05:00
NewCommand.cs PR Feedback 2016-08-30 12:00:56 -07:00
PackCommand.cs [WIP] Removes *3 verbs, making msbuild the driver (#4456) 2016-10-27 18:46:43 -07:00
PublishCommand.cs [WIP] Removes *3 verbs, making msbuild the driver (#4456) 2016-10-27 18:46:43 -07:00
RemoveP2PCommand.cs add some test cases stubs 2016-11-29 16:14:05 -08:00
RestoreCommand.cs Fixing full framework tests 2016-11-01 00:31:21 -07:00
RestoreProjectJsonCommand.cs [WIP] Removes *3 verbs, making msbuild the driver (#4456) 2016-10-27 18:46:43 -07:00
RunCommand.cs Migrating all test projects (#4668) 2016-11-11 21:46:29 -10:00
TestCommand.cs Fix output race (#4911) 2016-12-04 11:54:29 -08:00
TestCommandExtensions.cs [WIP] Removes *3 verbs, making msbuild the driver (#4456) 2016-10-27 18:46:43 -07:00
VSTestCommand.cs Implemented vstest verb which will run the test from given container. (#4115) 2016-09-19 10:59:26 -07:00