dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.27k stars 4.73k forks source link

Three System.Reflection.Tests.AssemblyTests tests failed with file sharing error #21070

Closed stephentoub closed 4 years ago

stephentoub commented 7 years ago
System.Reflection.Tests.AssemblyTests.Test_UnsafeLoadFrom [FAIL]
        System.IO.IOException : The process cannot access the file '/mnt/j/workspace/dotnet_corefx/master/ubuntu14.04_release_prtest/bin/AnyOS.AnyCPU.Release/System.Runtime.Tests/netcoreapp/TestAssembly/System.Runtime.Tests.dll' because it is being used by another process.
        Stack Trace:
              at System.IO.FileStream.Init(FileMode mode, FileShare share)
              at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
              at System.IO.UnixFileSystem.CopyFile(String sourceFullPath, String destFullPath, Boolean overwrite)
              at System.IO.File.InternalCopy(String sourceFileName, String destFileName, Boolean overwrite)
              at System.Reflection.Tests.AssemblyTests..ctor()
              at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
     System.Reflection.Tests.AssemblyTests.GetFiles [FAIL]
        System.IO.IOException : The process cannot access the file '/mnt/j/workspace/dotnet_corefx/master/ubuntu14.04_release_prtest/bin/AnyOS.AnyCPU.Release/System.Runtime.Tests/netcoreapp/TestAssembly/System.Runtime.Tests.dll' because it is being used by another process.
        Stack Trace:
              at System.IO.FileStream.Init(FileMode mode, FileShare share)
              at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
              at System.IO.UnixFileSystem.CopyFile(String sourceFullPath, String destFullPath, Boolean overwrite)
              at System.IO.File.InternalCopy(String sourceFileName, String destFileName, Boolean overwrite)
              at System.Reflection.Tests.AssemblyTests..ctor()
              at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
     System.Reflection.Tests.AssemblyTests.GetFile [FAIL]
        System.IO.IOException : The process cannot access the file '/mnt/j/workspace/dotnet_corefx/master/ubuntu14.04_release_prtest/bin/AnyOS.AnyCPU.Release/System.Runtime.Tests/netcoreapp/TestAssembly/System.Runtime.Tests.dll' because it is being used by another process.
        Stack Trace:
              at System.IO.FileStream.Init(FileMode mode, FileShare share)
              at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
              at System.IO.UnixFileSystem.CopyFile(String sourceFullPath, String destFullPath, Boolean overwrite)
              at System.IO.File.InternalCopy(String sourceFileName, String destFileName, Boolean overwrite)
              at System.Reflection.Tests.AssemblyTests..ctor()
              at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
ghost commented 7 years ago

@rahku - since you made the change to the test. Copying files to fixed-location tempfiles is probably not copacetic with CI.

KristinXie1 commented 7 years ago

This issue is repro on desktop, detail: https://ci.dot.net/job/dotnet_corefx/job/master/job/outerloop_netfx_windows_nt_debug/16/testReport/System.Reflection.Tests/AssemblyTests/Test_UnsafeLoadFrom/