Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Test runner fails to run on v4.3.0.13
shellicar
#1 Posted : Friday, April 3, 2020 8:15:03 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 5/25/2018(UTC)
Posts: 7
Location: Australia

Thanks: 1 times
Was thanked: 2 time(s) in 2 post(s)
Received the following error after updating to 4.3.0.13.

Code:
NCrunch: This test was executed on server '(local)'

NCrunch encountered an error while trying to construct an environment to execute this test: nCrunch.TaskRunner.Ipc.IpcConnectionClosedException: The connection has been closed
at nCrunch.Core.ProcessManagement.ExternalProcessManager.(EffectiveProcessorArchitecture , ProcessLoadParameters )
at nCrunch.Core.ProcessManagement.ExternalProcessManager.LoadExternalProcess(ProcessLoadParameters parameters, GridClientId client)
at nCrunch.Core.TestManagement.TestRunnerProcess..()
at nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity)
at nCrunch.Core.TestManagement.TestRunnerProcess.(Nullable`1 , FilePath , GridClientId , CustomVariable[] )
at nCrunch.Core.TestManagement.TestRunnerProcess..()
at nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity)
at nCrunch.Core.TestManagement.TestRunnerProcess.LoadTestRunnerProcessForProjectReturningProcessId(SnapshotComponent snapshotComponent, IList`1 componentsInProcess, TestFrameworkDescription[] testingFrameworks, Nullable`1 newProcessTag, FilePath solutionFilePath, GridClientId client, CustomVariable[] customEnvironmentVariables)
at nCrunch.Core.Processing.TestExecutionTaskLogic.DoProcessTaskAndReturnSuccessFlag()


Uninstalling NCrunch, then reinstalling v4.2.0.7 causes the tests to execute and pass.

Test project details.
Code:
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
</Project>
Remco
#2 Posted : Friday, April 3, 2020 11:13:44 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,049

Thanks: 787 times
Was thanked: 1023 time(s) in 974 post(s)
Hi, thanks for sharing this issue.

Are you able to recreate this problem with a sample solution? It's likely to be dependent on the main structural aspects of your project (i.e. framework, nuget references, etc), as opposed to your actual code.
shellicar
#3 Posted : Friday, April 3, 2020 11:20:54 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 5/25/2018(UTC)
Posts: 7
Location: Australia

Thanks: 1 times
Was thanked: 2 time(s) in 2 post(s)
Sure, I was able to reproduce this by narrowing down to the following two csproj entries.
The Sdk value, and the UseWindowsForms value.
This adds a reference to System.Windows.Forms for dotnet core targeting apps.

Note: In my actual test project, I no longer need a WindowsDesktop style sdk project,
so was able to get my tests working again with the latest version by reverting to a standard Sdk project.

NCrunchIssueRepro.csproj
Code:
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">

    <PropertyGroup>
        <TargetFramework>netcoreapp3.1</TargetFramework>
        <UseWindowsForms>true</UseWindowsForms>
    </PropertyGroup>

    <ItemGroup>
        <PackageReference Include="MSTest.TestFramework" Version="2.1.0" />
    </ItemGroup>

</Project>


UnitTest1.cs
Code:
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace NCrunchIssueRepro
{
[TestClass]
public class UnitTest1
{
[TestMethod]
public void TestMethod1()
{
}
}
}



Setting UseWindowsForms to false allows the test runner to run, but causes the following expected errror if any code is executed that references forms.
Code:
System.IO.FileNotFoundException: Could not load file or assembly 'System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. The system cannot find the file specified.
File name: 'System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
at Library.Class1.Test()
at NCrunchIssueRepro.UnitTest1.TestMethod1() in C:\Users\Stephen\source\repos\NCrunchIssueRepro\NCrunchIssueRepro\UnitTest1.cs:line 13
Remco
#4 Posted : Saturday, April 4, 2020 11:26:38 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,049

Thanks: 787 times
Was thanked: 1023 time(s) in 974 post(s)
Thanks for sharing this. I have a feeling about what may be going on here. We'll take a look and will let you know as soon as we have more information.
Remco
#5 Posted : Monday, April 27, 2020 1:21:29 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,049

Thanks: 787 times
Was thanked: 1023 time(s) in 974 post(s)
I'd like to apologise for the time it's taken for me to get back to you on this issue. The last few weeks have been very interesting for everyone.

I realise that this problem probably doesn't affect you any more, but I've prepared a build containing a fix for it just in case someone else happens to have a test project with the same structure. Naturally, this fix will also be included in the 4.4 release.

NCrunch_Console_4.4.0.9.msi
NCrunch_Console_4.4.0.9.zip
NCrunch_GridNodeServer_4.4.0.9.msi
NCrunch_GridNodeServer_4.4.0.9.zip
NCrunch_LicenseServer_4.4.0.9.zip
NCrunch_VS2008_4.4.0.9.msi
NCrunch_VS2010_4.4.0.9.msi
NCrunch_VS2010_4.4.0.9.zip
NCrunch_VS2012_4.4.0.9.msi
NCrunch_VS2012_4.4.0.9.zip
NCrunch_VS2013_4.4.0.9.msi
NCrunch_VS2013_4.4.0.9.zip
NCrunch_VS2015_4.4.0.9.msi
NCrunch_VS2015_4.4.0.9.msi.7z
NCrunch_VS2015_4.4.0.9.zip
NCrunch_VS2017_4.4.0.9.msi
NCrunch_VS2017_4.4.0.9.msi.7z
NCrunch_VS2017_4.4.0.9.zip
NCrunch_VS2019_4.4.0.9.msi
NCrunch_VS2019_4.4.0.9.msi.7z
NCrunch_VS2019_4.4.0.9.zip
1 user thanked Remco for this useful post.
shellicar on 5/10/2020(UTC)
shellicar
#6 Posted : Sunday, May 10, 2020 2:33:24 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 5/25/2018(UTC)
Posts: 7
Location: Australia

Thanks: 1 times
Was thanked: 2 time(s) in 2 post(s)
Remco;14677 wrote:
I'd like to apologise for the time it's taken for me to get back to you on this issue. The last few weeks have been very interesting for everyone.

I realise that this problem probably doesn't affect you any more, but I've prepared a build containing a fix for it just in case someone else happens to have a test project with the same structure. Naturally, this fix will also be included in the 4.4 release.

Thanks so much for taking the time to address this and post a solution in the interim.
Really appreciate it, and I understand that the current circumstances pose additional challenges.
1 user thanked shellicar for this useful post.
Remco on 5/10/2020(UTC)
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.052 seconds.