runtime: XmlDsigC14NTransformTest failure due to concurrent file access

@krwq @tintoy @anthonylangsworth there are several tests potentially creating a file named doc.dtd in the same folder concurrently.

They should use a pattern like

             using (var directory = new TempDirectory())
             using (var file = new TempFile(Path.Combine(directory.Path, "doc.dtd")))
            {.. }
MESSAGE:
System.IO.IOException : The process cannot access the file 'D:\\j\\workspace\\outerloop_win---bf7c4efa\\bin\\AnyOS.AnyCPU.Debug\\System.Security.Cryptography.Xml.Tests\\netcoreapp\\doc.dtd' because it is being used by another process.
+++++++++++++++++++
STACK TRACE:
at System.IO.FileStream.OpenHandle(FileMode mode, FileShare share, FileOptions options) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) at System.IO.FileStreamHelpers.CreateFileStream(String path, Boolean write, Boolean append) in D:\j\workspace\outerloop_win---bf7c4efa\src\System.Runtime.Extensions\src\System\IO\FileStreamHelpers.CoreClr.cs:line 10 at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize) in D:\j\workspace\outerloop_win---bf7c4efa\src\System.Runtime.Extensions\src\System\IO\StreamWriter.cs:line 140 at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding) in D:\j\workspace\outerloop_win---bf7c4efa\src\System.Runtime.Extensions\src\System\IO\StreamWriter.cs:line 125 at System.Security.Cryptography.Xml.Tests.XmlDsigC14NTransformTest.C14NSpecExample1() in D:\j\workspace\outerloop_win---bf7c4efa\src\System.Security.Cryptography.Xml\tests\XmlDsigC14NTransformTest.cs:line 217

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 38 (37 by maintainers)

Commits related to this issue

Most upvoted comments

I’ll let @krwq sign off… thanks for fixing so promptly

@krwq @tintoy I have (hopefully) resolved the concurrency issues with krwq#1. This appears to be causing some consternation, anyway.

… and welcome to my world trying to get these tests working in the first place. People wonder why I want to clean them up. 😃