Unhandled exception. System.IO.EndOfStreamException: Unable to read beyond the end of the stream.
Description
We are trying to enable macos pipeline for our new testing platform and we are getting quite a lot of our acceptance tests related to dump creation failing. See https://github.com/microsoft/testfx/pull/4155
One of the issue is:
Unhandled exception. System.IO.EndOfStreamException: Unable to read beyond the end of the stream.
at System.IO.BinaryReader.ReadUInt16()
at Microsoft.Diagnostics.NETCore.Client.IpcHeader.Parse(BinaryReader reader)
at Microsoft.Diagnostics.NETCore.Client.IpcMessage.Parse(Stream stream)
at Microsoft.Diagnostics.NETCore.Client.IpcClient.Read(Stream stream)
at Microsoft.Diagnostics.NETCore.Client.IpcClient.SendMessageGetContinuation(IpcEndpoint endpoint, IpcMessage message)
at Microsoft.Diagnostics.NETCore.Client.IpcClient.SendMessage(IpcEndpoint endpoint, IpcMessage message)
at Microsoft.Diagnostics.NETCore.Client.DiagnosticsClient.WriteDump(DumpType dumpType, String dumpPath, WriteDumpFlags flags)
at Microsoft.Diagnostics.NETCore.Client.DiagnosticsClient.WriteDump(DumpType dumpType, String dumpPath, Boolean logDumpGeneration)
at Microsoft.Testing.Extensions.Diagnostics.HangDumpProcessLifetimeHandler.TakeDumpAsync() in /_/src/Platform/Microsoft.Testing.Extensions.HangDump/HangDumpProcessLifetimeHandler.cs:line 375
at Microsoft.Testing.Extensions.Diagnostics.HangDumpProcessLifetimeHandler.ActivityTimerAsync() in /_/src/Platform/Microsoft.Testing.Extensions.HangDump/HangDumpProcessLifetimeHandler.cs:line 318
at Microsoft.Testing.Platform.Helpers.SystemTask.<>c__DisplayClass4_0.<RunLongRunning>b__0() in /_/src/Platform/Microsoft.Testing.Platform/Helpers/System/SystemTask.cs:line 33
at System.Threading.Thread.StartCallback()
Test suite failed with and exit code different that 2 (failed tests). Failure related to an unexpected condition. Exit code '134'
Configuration
We are using macos-latest on AzDO hosted pool.
Regression?
No idea, we are enabling macos. We recently bumped to 0.2.553101, I'll try to downgrade and see if that changes anything.
@mikem8361
Downgrading didn't help
@mikem8361 is there any plan or update around this please? We have another report of this failing on MacOS. https://github.com/microsoft/testfx/issues/5157#issuecomment-2693991606
Which prevents the user from getting dumps on MacOS and makes developing their testing framework (TUnit) harder.
We are still using version: <PackageVersion Include="Microsoft.Diagnostics.NETCore.Client" Version="0.2.553101" />
https://github.com/microsoft/testfx/blob/main/Directory.Packages.props#L49
@nohwnd We apologize for the delay! This issue is on our backlog, but until we have time to get to this issue, would it be possible to try updating to the latest released version of the net core client? https://github.com/dotnet/diagnostics/releases/tag/v9.0.607501. If that doesn't work, would it be possible to provide a small, reproducible test case we can use for investigation?
Still errors with an explicit reference to that package.
This repo can reproduce it: https://github.com/thomhurst/Microsoft.Testing.Platform.Reproductions/tree/d3e879aa41ccfd7973c0e129062a1ccc8b4114d1
How do I use the above repo to reproduction this issue? It only happens on MacOS? What version(s) of .NET is the target process running? I don't know for sure, but I think the older version of the client assembly is still being used because Microsoft.Testing.Extensions.HangDump references it even though the above project has a reference to the newer client version.
@mikem8361 The extension is targeting that version (https://github.com/microsoft/testfx/blob/61be9047fc4a92b2b8223271d88c718664145adf/Directory.Packages.props#L50), but the issue still happens. It's reproducible in CI at least on an app targeting net9.0
Any chance to have someone looking into this issue?