microsoft / CLRInstrumentationEngine

The CLR Instrumentation Engine is a cooperation profiler that allows running multiple profiling extensions in the same process.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

InstrMethodLoggingTestLevelNone and IstrMethodLoggingTestLevelSome failing locally

delmyers opened this issue · comments

This is potentially a race between the two processes that are running because they seem to pass when they are run independently. These are the two errors:

Message:
Test method InstrEngineTests.TestInstrumentationMethodLogging.InstrMethodLoggingTestLevelNone threw exception:
System.IO.FileNotFoundException: Could not find file 'C:\dd\CLRIE2\TestResults\Deploy_delmyers 2020-10-20 21_34_23\Out\TestResults\InstrumentationMethodLoggingNone.xml'.
Stack Trace:
__Error.WinIOError(Int32 errorCode, String maybeFullPath)
FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
FileStream.ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
StreamReader.ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize, Boolean checkHost)
StreamReader.ctor(String path)
ProfilerHelpers.DiffResultToBaseline(String output, String baseline, Boolean regexCompare) line 204
TestInstrumentationMethodLogging.InstrMethodLoggingTestLevelNone() line 40

Message:
Test method InstrEngineTests.TestInstrumentationMethodLogging.InstrMethodLoggingTestLevelSome threw exception:
System.Xml.XmlException: Data at the root level is invalid. Line 1, position 1.
Stack Trace:
XmlTextReaderImpl.Throw(Exception e)
XmlTextReaderImpl.Throw(String res, String arg)
XmlTextReaderImpl.ParseRootLevelWhitespace()
XmlTextReaderImpl.ParseDocumentContent()
XmlTextReaderImpl.Read()
XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
XmlDocument.Load(XmlReader reader)
XmlDocument.LoadXml(String xml)
ProfilerHelpers.DiffResultToBaseline(String output, String baseline, Boolean regexCompare) line 262
TestInstrumentationMethodLogging.InstrMethodLoggingTestLevelSome() line 58

I can take a look

#355 fixed this issue. The TestParameters instance was shared among all running tests, thus when mutating settings on it, there are race conditions when executing the tests. The applied fix was to create a unique instance for each test.