Ends in:
2 DAYS
14 HRS
45 MIN
32 SEC
Ends in:
2 D
14 H
45 M
32 S
Open Closed

vs testhost crashes when volo commercial package is used #2204


User avatar
0
raif created

Check the vstest platform architecture: https://github.com/microsoft/vstest-docs/blob/main/RFCs/0001-Test-Platform-Architecture.md Check the vstest data collectors: https://github.com/microsoft/vstest-docs/blob/main/RFCs/0006-DataCollection-Protocol.md Check the .runtimesettings : https://docs.microsoft.com/en-us/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file?branch=release-16.4&view=vs-2019

  • ABP Framework version: v4.4.4
  • UI type: MVC
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace: Error occurred during initialization of TestHost : System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) --- End of inner exception stack trace --- at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) at System.IO.Stream.ReadByte() at System.IO.BinaryReader.ReadByte() at System.IO.BinaryReader.Read7BitEncodedInt() at System.IO.BinaryReader.ReadString() at Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.SocketCommunicationManager.ReceiveRawMessage() at Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.SocketCommunicationManager.ReceiveMessage() at Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.DataCollection.DataCollectionTestCaseEventHandler.ProcessRequests() at Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.DataCollection.DataCollectionRequestHandler.<HandleBeforeTestRunStart>b__24_0()
  • Steps to reproduce the issue:"
  1. create new project by using abp suite module template
  2. add commercial package to the domain layer (e.g. filemanagement)
  3. create a new unit test (no extra step taken after code generation)
  4. try to debug/run test

my unit tests are not running when i use commercial volo packages in my module project i believe that is due to their license check

to collect for information regarding error i tried attached data collector to my testhost

datacollector log indicates :

TpTrace Information: 0 : 29556, 1, 2021/11/29, 10:18:52.689, 5623983708510, datacollector.exe, Listening on Endpoint : 127.0.0.1:58503
TpTrace Information: 0 : 29556, 1, 2021/11/29, 10:18:52.709, 5623983903030, datacollector.exe, DataCollectionRequestHandler.ProcessRequests : DataCollection started.
TpTrace Information: 0 : 29556, 1, 2021/11/29, 10:18:52.752, 5623984339050, datacollector.exe, DataCollectionRequestHandler.ProcessRequests : Datacollector received message: (DataCollection.TestHostLaunched) -> {
  "ProcessId": 22052
}
TpTrace Information: 0 : 29556, 1, 2021/11/29, 10:18:52.778, 5623984599936, datacollector.exe, ProcessDumpUtility.CrashDump: Creating mini dump of process testhost.x86 (22052) into temporary path 'C:\Users\xxxxxxx\AppData\Local\Temp\c0e3fc35-5300-4319-a040-548012a5c65a'.
TpTrace Information: 0 : 29556, 1, 2021/11/29, 10:18:52.780, 5623984616998, datacollector.exe, CrashDumperFactory: Creating dumper for Microsoft Windows 10.0.19042  with target framework .NETCoreApp,Version=v5.0.
TpTrace Information: 0 : 29556, 1, 2021/11/29, 10:18:52.780, 5623984618606, datacollector.exe, CrashDumperFactory: This is Windows on .NETCoreApp,Version=v5.0, returning the .NETClient dumper which uses env variables to collect crashdumps of testhost and any child process.
TpTrace Information: 0 : 29556, 4, 2021/11/29, 10:18:53.106, 5623987877765, datacollector.exe, Using the buffer size of 16384 bytes
TpTrace Information: 0 : 29556, 4, 2021/11/29, 10:18:53.106, 5623987878866, datacollector.exe, Accepted Client request and set the flag
TpTrace Information: 0 : 29556, 7, 2021/11/29, 10:19:06.855, 5624125359620, datacollector.exe, DataCollectionTestCaseEventHandler: Test case starting.
TpTrace Information: 0 : 29556, 7, 2021/11/29, 10:19:06.900, 5624125815083, datacollector.exe, Blame Collector : Test Case Start
TpTrace Information: 0 : 29556, 7, 2021/11/29, 10:19:06.902, 5624125830635, datacollector.exe, DataCollectionTestCaseEventHandler: Test case 'Siemens.Odms.Samples.SampleAppService_Tests.GetAsync - 59f413e1-9026-3a67-eb02-b7f70f6b998a' started.
TpTrace Error: 0 : 29556, 7, 2021/11/29, 10:19:08.834, 5624145153965, datacollector.exe, DataCollectionRequestHandler.HandleBeforeTestRunStart : Error occurred during initialization of TestHost : System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
   at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
   --- End of inner exception stack trace ---
   at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
   at System.IO.Stream.ReadByte()
   at System.IO.BinaryReader.ReadByte()
   at System.IO.BinaryReader.Read7BitEncodedInt()
   at System.IO.BinaryReader.ReadString()
   at Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.SocketCommunicationManager.ReceiveRawMessage()
   at Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.SocketCommunicationManager.ReceiveMessage()
   at Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.DataCollection.DataCollectionTestCaseEventHandler.ProcessRequests()
   at Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.DataCollection.DataCollectionRequestHandler.<HandleBeforeTestRunStart>b__24_0()
TpTrace Information: 0 : 29556, 1, 2021/11/29, 10:19:08.868, 5624145489916, datacollector.exe, DataCollectionRequestHandler.ProcessRequests : Datacollector received message: (DataCollection.AfterTestRunEnd) -> false

My current abp license allows me to access the commercial module source code. So i just disabled license checker at app init stage

Now i can run my unit test after this modification

Can you share an example project that shows how unit tests should be if we use a commercial package within the module? br


4 Answer(s)
  • User Avatar
    0
    raif created

    /bump

  • User Avatar
    0
    cotur created

    I am working on this issue now, will be replied soon.

  • User Avatar
    0
    cotur created

    Hello @raif

    Unfortunately, this problem has no workaround and there is only one way to fix it that upgrading your solution to the new version.

    ABP 5.0 has been released with the RC version and stable version will be released soon. With 5.0 version, this problem will be fixed.

    Thank you.

  • User Avatar
    0
    raif created

    Ok, thx for the fix and update, i will look forward 5.0 release

Made with ❤️ on ABP v9.1.0-preview. Updated on December 02, 2024, 12:35