Bug Report T706240
Visible to All Users

Unit Testing - An unexpected error is raised when tests run for the second time

created 6 years ago

We are implementing unit Tests by using using Microsoft.VisualStudio.TestTools.UnitTesting;

The Tests are executed using CodeRush Test Runner.

I just upgraded to the latest VS 2017 update. Since then I Always can run a unit test only once.
When I try to run a test a second time then I get an unexpected error which tells me to check the test Output.
The Content of the Output of Test Runner then looks as follows:

Test started…
 Summary: Passed: 0, Failed: 0, Ignored: 0
Duration: 5.24 seconds

The Content of the Output Tests Windows Looks as follows:

[11.01.2019 12:05:12 Informational] ------ Discover test started ------
[11.01.2019 12:05:13 Warning] Die Datei "D:\DevDotNet\DotNetAppl\ACAG.HotConnector\DEV_ACAG.HotConnector_2017_01\ACAG.HotWebAPI.Common.Tests\bin\Debug\ACAG.HotWebAPI.Common.Tests.dll" wurde nicht gefunden.
[11.01.2019 12:05:13 Error] Die Datei "D:\DevDotNet\DotNetAppl\ACAG.HotConnector\DEV_ACAG.HotConnector_2017_01\ACAG.HotWebAPI.Common.Tests\bin\Debug\ACAG.HotWebAPI.Common.Tests.dll" konnte nicht gefunden werden.
[11.01.2019 12:05:14 Warning] In D:\DevDotNet\DotNetAppl\ACAG.HotConnector\DEV_ACAG.HotConnector_2017_01\ACAG.HotTest\ACAG.HotTest.csproj ist kein Test verfügbar. Stellen Sie sicher, dass Testdiscoverer und -executor registriert und die Versionseinstellungen für Plattform und Framework richtig sind, und versuchen Sie es anschließend noch mal.
[11.01.2019 12:05:16 Warning] [MSTest][Discovery][D:\DevDotNet\DotNetAppl\ACAG.HotConnector\DEV_ACAG.HotConnector_2017_01\ACAG.HotWebAPI.Common.Tests\bin\Debug\ACAG.HotWebAPI.Common.Tests.dll] Fehler beim Ermitteln von Tests aus der Assembly "D:\DevDotNet\DotNetAppl\ACAG.HotConnector\DEV_ACAG.HotConnector_2017_01\ACAG.HotWebAPI.Common.Tests\bin\Debug\ACAG.HotWebAPI.Common.Tests.dll". Ursache:Die Datei ist nicht vorhanden: D:\DevDotNet\DotNetAppl\ACAG.HotConnector\DEV_ACAG.HotConnector_2017_01\ACAG.HotWebAPI.Common.Tests\bin\Debug\ACAG.HotWebAPI.Common.Tests.dll
[11.01.2019 12:05:17 Informational] ========== Discover test finished: 1093 found (0:00:04.5024962) ==========

to get the test running again I have to kill the testing processes:

taskkill /F /IM vstest.console.exe
taskkill /F /IM vstest.discoveryengine.x86.exe
taskkill /F /IM vstest.executionengine.x86.exe

Running the same test by using the VS Test Explorer seems to work correctly.

Could you please help me in Fixing this Problem because this is really ugly.

Best regards,
Alex

Show previous comments (2)
DevExpress Support Team 6 years ago

    Hi Alex,
    We made some changes to fix this issue. The problem is no longer reproduced on our side.
    Could you please try to reproduce this issue on this build?
    We are looking forward to hearing from you.

    SD SD
    Software Development 6 years ago

      Hi George

      The fix works perfectly.

      Thank you very much.

      Can I assume that this fix will be included in the next update?

      Best regards,
      Alex

      DevExpress Support Team 6 years ago

        Hi Alex.
        Of course, this fix will be included in the next update.

        Answers approved by DevExpress Support

        created 6 years ago

        We have fixed the issue described in this ticket and will include the fix in our next maintenance update. To apply this solution before the official update, request a hotfix by clicking the corresponding link for product versions you require.

        Note: Hotfixes may be unavailable for beta versions and updates that are about to be released.

          Comments (2)

            Issue is still happening to me on VS2019 with 18.2.9

            DevExpress Support Team 6 years ago

              Hi Dan,

              In Visual Studio 2019 there are many changes in the unit testing engine and CodeRush has a separate provider for this test framework. So, it seems that your issue has another nature than the initial problem. To process it more efficiently I've created a separate ticket on your behalf: Test Runner - An unexpected error while running tests in Visual Studio 2019. Let's continue our discussion there.

              Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

              Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.