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

Unable to connect to testing platform runner process when using testing platform server mode #4729

Open
xperiandri opened this issue Jan 20, 2025 · 7 comments
Labels
Area: Server Mode Area: Testing Platform Belongs to the Microsoft.Testing.Platform core library Needs: Triage 🔍

Comments

@xperiandri
Copy link

Describe the bug

When this flag is enable
Image

I see

Log level is set to Informational (Default).
Multiple source code repositories are available, using C:\Users\Andrii\Dev\eCierge\PropertyManagement as the repository root.
Connected to test environment '< Local Windows Environment >'
Test data store opened in 0,060 sec.
========== Starting test discovery ==========
Unable to connect to testing platform runner process 'C:\Users\Andrii\Dev\eCierge\PropertyManagement\Server.Tests\Persistence.Identity\bin\Debug\net8.0\Ecierge.Server.Tests.Persistence.Identity.dll'.
Aborting test discovery because a build was performed.
Unable to connect to testing platform runner process 'C:\Users\Andrii\Dev\eCierge\PropertyManagement\Server.Administration\Tests.Integration.GraphQL\bin\Debug\net8.0\Ecierge.Server.Administration.GraphQL.Tests.Integration.dll'.
Unable to connect to testing platform runner process 'C:\Users\Andrii\Dev\eCierge\PropertyManagement\Server.Construction\Tests.Integration.GraphQL\bin\Debug\net8.0\Ecierge.Server.Construction.GraphQL.Tests.Integration.dll'.
Unable to connect to testing platform runner process 'C:\Users\Andrii\Dev\eCierge\PropertyManagement\Server.Tests\Persistence.AzureCosmos\bin\Debug\net8.0\Ecierge.Server.Tests.Persistence.AzureCosmos.dll'.
Unable to connect to testing platform runner process 'C:\Users\Andrii\Dev\eCierge\PropertyManagement\Server.Tests\Integration.GraphQL\bin\Debug\net8.0\Ecierge.Server.Tests.Integration.GraphQL.dll'.
========== Test discovery aborted: 0 Tests found in 3,4 sec ==========
========== Starting test discovery ==========
Unable to connect to testing platform runner process 'C:\Users\Andrii\Dev\eCierge\PropertyManagement\Server.Administration\Tests.Integration.GraphQL\bin\Debug\net8.0\Ecierge.Server.Administration.GraphQL.Tests.Integration.dll'.
Unable to connect to testing platform runner process 'C:\Users\Andrii\Dev\eCierge\PropertyManagement\Server.Construction\Tests.Integration.GraphQL\bin\Debug\net8.0\Ecierge.Server.Construction.GraphQL.Tests.Integration.dll'.
Unable to connect to testing platform runner process 'C:\Users\Andrii\Dev\eCierge\PropertyManagement\Server.Tests\Persistence.Identity\bin\Debug\net8.0\Ecierge.Server.Tests.Persistence.Identity.dll'.
Unable to connect to testing platform runner process 'C:\Users\Andrii\Dev\eCierge\PropertyManagement\Server.Tests\Integration.GraphQL\bin\Debug\net8.0\Ecierge.Server.Tests.Integration.GraphQL.dll'.
Unable to connect to testing platform runner process 'C:\Users\Andrii\Dev\eCierge\PropertyManagement\Server.Tests\Persistence.AzureCosmos\bin\Debug\net8.0\Ecierge.Server.Tests.Persistence.AzureCosmos.dll'.
No test is available in C:\Users\Andrii\Dev\eCierge\PropertyManagement\Server.Tests\Persistence.Models.Hedgehog\bin\Debug\net8.0\Ecierge.Server.Tests.Persistence.Models.Hedgehog.dll. Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again.
No test is available in C:\Users\Andrii\Dev\eCierge\PropertyManagement\Shared.Tests\Models.Hedgehog\bin\Debug\net8.0\Ecierge.Tests.Models.Hedgehog.dll. Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again.
========== Test discovery aborted: 43 Tests found in 9,2 sec ==========
Resuming previously aborted test discovery
========== Starting test discovery ==========
Unable to connect to testing platform runner process 'C:\Users\Andrii\Dev\eCierge\PropertyManagement\Server.Tests\Persistence.Identity\bin\Debug\net8.0\Ecierge.Server.Tests.Persistence.Identity.dll'.
Unable to connect to testing platform runner process 'C:\Users\Andrii\Dev\eCierge\PropertyManagement\Server.Tests\Persistence.AzureCosmos\bin\Debug\net8.0\Ecierge.Server.Tests.Persistence.AzureCosmos.dll'.
Unable to connect to testing platform runner process 'C:\Users\Andrii\Dev\eCierge\PropertyManagement\Server.Tests\Integration.GraphQL\bin\Debug\net8.0\Ecierge.Server.Tests.Integration.GraphQL.dll'.
Unable to connect to testing platform runner process 'C:\Users\Andrii\Dev\eCierge\PropertyManagement\Server.Administration\Tests.Integration.GraphQL\bin\Debug\net8.0\Ecierge.Server.Administration.GraphQL.Tests.Integration.dll'.
Unable to connect to testing platform runner process 'C:\Users\Andrii\Dev\eCierge\PropertyManagement\Server.Construction\Tests.Integration.GraphQL\bin\Debug\net8.0\Ecierge.Server.Construction.GraphQL.Tests.Integration.dll'.
========== Test discovery aborted: 0 Tests found in 3,9 sec ==========
========== Starting test discovery ==========
Unable to connect to testing platform runner process 'C:\Users\Andrii\Dev\eCierge\PropertyManagement\Server.Construction\Tests.Integration.GraphQL\bin\Debug\net8.0\Ecierge.Server.Construction.GraphQL.Tests.Integration.dll'.
Unable to connect to testing platform runner process 'C:\Users\Andrii\Dev\eCierge\PropertyManagement\Server.Administration\Tests.Integration.GraphQL\bin\Debug\net8.0\Ecierge.Server.Administration.GraphQL.Tests.Integration.dll'.
Unable to connect to testing platform runner process 'C:\Users\Andrii\Dev\eCierge\PropertyManagement\Server.Tests\Persistence.AzureCosmos\bin\Debug\net8.0\Ecierge.Server.Tests.Persistence.AzureCosmos.dll'.
Unable to connect to testing platform runner process 'C:\Users\Andrii\Dev\eCierge\PropertyManagement\Server.Tests\Persistence.Identity\bin\Debug\net8.0\Ecierge.Server.Tests.Persistence.Identity.dll'.
Unable to connect to testing platform runner process 'C:\Users\Andrii\Dev\eCierge\PropertyManagement\Server.Tests\Integration.GraphQL\bin\Debug\net8.0\Ecierge.Server.Tests.Integration.GraphQL.dll'.
========== Test discovery aborted: 0 Tests found in 4,1 sec ==========

Steps To Reproduce

I don't know. How can I reproduce that?

Expected behavior

Tests are discovered

Actual behavior

Tests are not discovered

Additional context

Both
Microsoft Visual Studio Enterprise 2022 (64-bit) Version 17.12.4
Microsoft Visual Studio Enterprise 2022 (64-bit) Version 17.13.0 Preview 2.1
affected

<PackageVersion Include="Microsoft.TestPlatform.TestHost" Version="17.10.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageVersion Include="MSTest.TestAdapter" Version="3.7.1" />
<PackageVersion Include="MSTest.TestFramework" Version="3.7.1" />

also I see

[MSTest][Discovery][C:\Users\Andrii\Dev\eCierge\PropertyManagement\Server.Tests\Integration\bin\Debug\net8.0\Ecierge.Server.Tests.Integration.dll] TestClass attribute defined on generic non-abstract class Ecierge.Server.Tests.Integration.IntegrationTestBase`1
No test is available in C:\Users\Andrii\Dev\eCierge\PropertyManagement\Server.Tests\Persistence.Models.Hedgehog\bin\Debug\net8.0\Ecierge.Server.Tests.Persistence.Models.Hedgehog.dll. Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again.
Error:
  An assembly specified in the application dependencies manifest (Ecierge.Testing.deps.json) was not found:
    package: 'BlackFox.MasterOfFoo', version: '2.1.0'
    path: 'lib/net5.0/BlackFox.MasterOfFoo.dll'
Microsoft.VisualStudio.TestPlatform.ObjectModel.TestPlatformException: Testhost process for source(s) 'C:\Users\Andrii\Dev\eCierge\PropertyManagement\Testing\bin\Debug\net8.0\Ecierge.Testing.dll' exited with error: Error:
  An assembly specified in the application dependencies manifest (Ecierge.Testing.deps.json) was not found:
    package: 'BlackFox.MasterOfFoo', version: '2.1.0'
    path: 'lib/net5.0/BlackFox.MasterOfFoo.dll'
. Please check the diagnostic logs for more information.
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyOperationManager.ThrowOnTestHostExited(IEnumerable`1 sources, Boolean testHostExited) in /_/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyOperationManager.cs:line 524
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyOperationManager.SetupChannel(IEnumerable`1 sources, String runSettings) in /_/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyOperationManager.cs:line 293
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyDiscoveryManager.InitializeDiscovery(DiscoveryCriteria discoveryCriteria, ITestDiscoveryEventsHandler2 eventHandler, Boolean skipDefaultAdapters) in /_/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyDiscoveryManager.cs:line 147
@Youssef1313 Youssef1313 added Area: Testing Platform Belongs to the Microsoft.Testing.Platform core library Area: Server Mode labels Jan 20, 2025
@Evangelink
Copy link
Member

Are you using VSTest or Microsoft.Testing.Platform? Have you enabled EnableMSTestRunner property? If so, can you try to DotNet run or F5 the test project to see if it works?

If you have then you don't need the Test host package.

@Joy-less
Copy link

Joy-less commented Jan 21, 2025

Can confirm that this issue prevents testing with MSTest (freezes indefinitely) and can be fixed by disabling the Use testing platform server mode flag.

@EvgenyMuryshkin
Copy link

Without server mode, MSTest discovery fails with

Could not load file or assembly 'Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.

@xperiandri
Copy link
Author

If so, can you try to DotNet run or F5 the test project to see if it works?

It works

@xperiandri
Copy link
Author

Have you enabled EnableMSTestRunner property?

Yes

@xperiandri
Copy link
Author

Without server mode, MSTest discovery fails

@EvgenyMuryshkin Probably SDK package is too new for your Visual Studio

@Evangelink
Copy link
Member

@xperiandri is dropping <PackageVersion Include="Microsoft.TestPlatform.TestHost" Version="17.10.0" /> helping? This package is VSTest oriented and should not be mixed with MSTest runner.

@EvgenyMuryshkin Can you provide more info and maybe open a different issue as it seems unrelated to this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Server Mode Area: Testing Platform Belongs to the Microsoft.Testing.Platform core library Needs: Triage 🔍
Projects
None yet
Development

No branches or pull requests

5 participants