Code Coverage collection Fails with "System.IO.IOException: Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host.."

Đang mở
#154 15 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
csharp
Lĩnh vực
testing

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện lệnh dotnet test được cung cấp với tính năng thu thập độ bao phủ mã được bật, sau đó kiểm tra các luồng giao tiếp và thu thập dữ liệu được nêu trong stack trace, đặc biệt là SocketCommunicationManager và DataCollectionRequestSender. Công việc được coi là hoàn tất khi các bài kiểm thử hoàn thành với tính năng thu thập độ bao phủ được bật mà không gặp ngoại lệ kết nối truyền tải.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

I am running unit tests locally on my workstation and started seeing some errors occurring with my tests. The tests all seem to pass just fine but when it seems to be collecting Code Coverage data I get a lot of the following errors

System.IO.IOException: Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host..
 ---> System.Net.Sockets.SocketException (10054): An existing connection was forcibly closed by the remote host.
   at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 count)
   --- End of inner exception stack trace ---
   at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 count)
   at System.IO.BufferedStream.Flush()
   at Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.SocketCommunicationManager.WriteAndFlushToChannel(String rawMessage) in /_/src/Microsoft.TestPlatform.CommunicationUtilities/SocketCommunicationManager.cs:line 413
   at Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.DataCollection.DataCollectionRequestSender.SendAfterTestRunEndAndGetResult(ITestMessageEventHandler runEventsHandler, Boolean isCancelled) in /_/src/Microsoft.TestPlatform.CommunicationUtilities/DataCollectionRequestSender.cs:line 155
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.DataCollection.ProxyDataCollectionManager.<>c__DisplayClass20_0.<AfterTestRunEnd>b__0() in /_/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/ProxyDataCollectionManager.cs:line 155
   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.DataCollection.ProxyDataCollectionManager.InvokeDataCollectionServiceAction(Action action, ITestMessageEventHandler runEventsHandler) in /_/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/ProxyDataCollectionManager.cs:line 288

If I remove code coverage (essentially the --collect parameter) my tests work and complete as expected. This is using dotnet 9.0.102

dotnet test "./Framework/Framework.sln" -c Release -bl:./"Framework.Tests.binlog"  --no-build --no-restore --results-directory ./TestResults --collect:"Code Coverage;Format=cobertura"
Ngôn ngữ chính
C#
Star
125
Fork
17
Merge trung bình
1 giờ 17 phút
Pull request đã merge (30 ngày)
2

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của microsoft/codecoverage

Tất cả issue của microsoft/codecoverage

Issue tương tự

Thêm issue về C#

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.