-
Notifications
You must be signed in to change notification settings - Fork 386
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
Coverlet unable to instrument module after .NET 7 update #1404
Comments
As an update, we had OutputPath tags in the csproj for all of our test projects that were outputting all test projects to the same directory. If we remove those tags from the test projects and allow them to be outputted to separate directories, then "Unable to instrument module" goes away and the build passed. I suppose I will leave this open as outputting to one directory previously worked, in case anyone has any ideas/comments |
we run into the same issue. We restore test packages from binaries using a temp project. All binaries get copied into one output. |
I'm seeing this same issue but in net 6.0 |
@mfisher214 sorry for the late response. I'm not aware of any other issues related to .NET 7 than the one you already mentioned. Would it be possible that someone could provide a simple repro for that? |
This issue is stale because it has been open for 3 months with no activity. |
issue is meanwhile outdated. coverlet tests are targeting net6.0 and net8.0 with PR #1544 |
coverlet V6.0.1 is released. |
I'm seeing the same infinite recursion in Cecil. |
@YoshiRulz Please provide more information e.g. diagnostic logs and steps to reproduce
Please also create a new issue. This one was closed. |
After update to dotnet 7, I am seeing these warnings at the beginning of our Test phase (they also appear on local when running dotnet test):
/home/vsts/work/1/.nuget/packages/coverlet.msbuild/3.2.0/build/coverlet.msbuild.targets(39,5): warning : [coverlet] Unable to instrument module: /home/vsts/work/1/s/build/tests/Release/net7.0/(project file).dll [/home/vsts/work/1/s/tests/dotnet/(project file).csproj]
/home/vsts/work/1/.nuget/packages/coverlet.msbuild/3.2.0/build/coverlet.msbuild.targets(39,5): warning : System.IO.IOException: The process cannot access the file '/home/vsts/work/1/s/build/tests/Release/net7.0/(project file).pdb' because it is being used by another process. [/home/vsts/work/1/s/tests/dotnet/(project file).csproj]
/home/vsts/work/1/.nuget/packages/coverlet.msbuild/3.2.0/build/coverlet.msbuild.targets(39,5): warning : at Microsoft.Win32.SafeHandles.SafeFileHandle.Init(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Int64& fileLength, UnixFileMode& filePermissions) [/home/vsts/work/1/s/tests/dotnet/(project file).csproj]
/home/vsts/work/1/.nuget/packages/coverlet.msbuild/3.2.0/build/coverlet.msbuild.targets(39,5): warning : at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, UnixFileMode openPermissions, Int64& fileLength, UnixFileMode& filePermissions, Func
4 createOpenException) [/home/vsts/work/1/s/tests/dotnet/(project file).csproj] /home/vsts/work/1/.nuget/packages/coverlet.msbuild/3.2.0/build/coverlet.msbuild.targets(39,5): warning : at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable
1 unixCreateMode) [/home/vsts/work/1/s/tests/dotnet/(project file).csproj]/home/vsts/work/1/.nuget/packages/coverlet.msbuild/3.2.0/build/coverlet.msbuild.targets(39,5): warning : at System.IO.File.OpenWrite(String path) [/home/vsts/work/1/s/tests/dotnet/(project file).csproj]
/home/vsts/work/1/.nuget/packages/coverlet.msbuild/3.2.0/build/coverlet.msbuild.targets(39,5): warning : at Mono.Cecil.Cil.PortablePdbWriterProvider.GetSymbolWriter(ModuleDefinition module, String fileName) [/home/vsts/work/1/s/tests/dotnet/(project file).csproj]
/home/vsts/work/1/.nuget/packages/coverlet.msbuild/3.2.0/build/coverlet.msbuild.targets(39,5): warning : at Mono.Cecil.Cil.DefaultSymbolWriterProvider.GetSymbolWriter(ModuleDefinition module, String fileName) [/home/vsts/work/1/s/tests/dotnet/(project file).csproj]
/home/vsts/work/1/.nuget/packages/coverlet.msbuild/3.2.0/build/coverlet.msbuild.targets(39,5): warning : at Mono.Cecil.ModuleWriter.GetSymbolWriter(ModuleDefinition module, String fq_name, ISymbolWriterProvider symbol_writer_provider, WriterParameters parameters) [/home/vsts/work/1/s/tests/dotnet/(project file).csproj]
/home/vsts/work/1/.nuget/packages/coverlet.msbuild/3.2.0/build/coverlet.msbuild.targets(39,5): warning : at Mono.Cecil.ModuleWriter.Write(ModuleDefinition module, Disposable
1 stream, WriterParameters parameters) [/home/vsts/work/1/s/tests/dotnet/(project file).csproj] /home/vsts/work/1/.nuget/packages/coverlet.msbuild/3.2.0/build/coverlet.msbuild.targets(39,5): warning : at Mono.Cecil.ModuleWriter.WriteModule(ModuleDefinition module, Disposable
1 stream, WriterParameters parameters) [/home/vsts/work/1/s/tests/dotnet/(project file).csproj]/home/vsts/work/1/.nuget/packages/coverlet.msbuild/3.2.0/build/coverlet.msbuild.targets(39,5): warning : at Mono.Cecil.ModuleDefinition.Write(Stream stream, WriterParameters parameters) [/home/vsts/work/1/s/tests/dotnet/(project file).csproj]
/home/vsts/work/1/.nuget/packages/coverlet.msbuild/3.2.0/build/coverlet.msbuild.targets(39,5): warning : at Coverlet.Core.Instrumentation.Instrumenter.InstrumentModule() in //src/coverlet.core/Instrumentation/Instrumenter.cs:line 337 [/home/vsts/work/1/s/tests/dotnet/(project file).csproj]
/home/vsts/work/1/.nuget/packages/coverlet.msbuild/3.2.0/build/coverlet.msbuild.targets(39,5): warning : at Coverlet.Core.Instrumentation.Instrumenter.Instrument() in //src/coverlet.core/Instrumentation/Instrumenter.cs:line 153 [/home/vsts/work/1/s/tests/dotnet/(project file).csproj]
/home/vsts/work/1/.nuget/packages/coverlet.msbuild/3.2.0/build/coverlet.msbuild.targets(39,5): warning : at Coverlet.Core.Coverage.PrepareModules() in //src/coverlet.core/Coverage.cs:line 135 [/home/vsts/work/1/s/tests/dotnet/(project file).csproj]
/home/vsts/work/1/.nuget/packages/coverlet.msbuild/3.2.0/build/coverlet.msbuild.targets(39,5): error : The process cannot access the file '/home/vsts/work/1/s/build/tests/Release/net7.0/(project file).pdb' because it is being used by another process. [/home/vsts/work/1/s/tests/dotnet/(project file).csproj]
/home/vsts/work/1/.nuget/packages/coverlet.msbuild/3.2.0/build/coverlet.msbuild.targets(39,5): error : at Microsoft.Win32.SafeHandles.SafeFileHandle.Init(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Int64& fileLength, UnixFileMode& filePermissions) [/home/vsts/work/1/s/tests/dotnet/(project file).csproj]
/home/vsts/work/1/.nuget/packages/coverlet.msbuild/3.2.0/build/coverlet.msbuild.targets(39,5): error : at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, UnixFileMode openPermissions, Int64& fileLength, UnixFileMode& filePermissions, Func`4 createOpenException) [/home/vsts/work/1/s/tests/dotnet/(project file).csproj]
/home/vsts/work/1/.nuget/packages/coverlet.msbuild/3.2.0/build/coverlet.msbuild.targets(39,5): error : at System.IO.FileSystem.CopyFile(String sourceFullPath, String destFullPath, Boolean overwrite) [/home/vsts/work/1/s/tests/dotnet/(project file).csproj]
/home/vsts/work/1/.nuget/packages/coverlet.msbuild/3.2.0/build/coverlet.msbuild.targets(39,5): error : at Coverlet.Core.Helpers.FileSystem.Copy(String sourceFileName, String destFileName, Boolean overwrite) in //src/coverlet.core/Helpers/FileSystem.cs:line 35 [/home/vsts/work/1/s/tests/dotnet/(project file).csproj]
/home/vsts/work/1/.nuget/packages/coverlet.msbuild/3.2.0/build/coverlet.msbuild.targets(39,5): error : at Coverlet.Core.Helpers.InstrumentationHelper.BackupOriginalModule(String module, String identifier) in //src/coverlet.core/Helpers/InstrumentationHelper.cs:line 227 [/home/vsts/work/1/s/tests/dotnet/(project file).csproj]
/home/vsts/work/1/.nuget/packages/coverlet.msbuild/3.2.0/build/coverlet.msbuild.targets(39,5): error : at Coverlet.Core.Coverage.PrepareModules() in //src/coverlet.core/Coverage.cs:line 130 [/home/vsts/work/1/s/tests/dotnet/(project file).csproj]
/home/vsts/work/1/.nuget/packages/coverlet.msbuild/3.2.0/build/coverlet.msbuild.targets(39,5): error : at Coverlet.MSbuild.Tasks.InstrumentationTask.Execute() in /_/src/coverlet.msbuild.tasks/InstrumentationTask.cs:line 116 [/home/vsts/work/1/s/tests/dotnet/(project file).csproj]
The Test phase eventually fails with error:
The active test run was aborted. Reason: Test host process crashed
Test Run Aborted with error System.Exception: One or more errors occurred.
---> System.Exception: Unable to read beyond the end of the stream.
at System.IO.BinaryReader.Read7BitEncodedInt()
at System.IO.BinaryReader.ReadString()
at Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.LengthPrefixCommunicationChannel.NotifyDataAvailable()
at Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.TcpClientExtensions.MessageLoopAsync(TcpClient client, ICommunicationChannel channel, Action`1 errorHandler, CancellationToken cancellationToken)
--- End of inner exception stack trace ---.
I am aware of some other open issues related to coverlet since .NET 7 RC 1 (#1391, microsoft/vstest#4014) - Is this a known issue as well, or is anyone else running into this? I am struggling to find any documentation on it
The text was updated successfully, but these errors were encountered: