未验证 提交 d32cb1f4 编写于 作者: D David Mason 提交者: GitHub

Add debug output to...

Add debug output to BasicEventSourceTests.TestsManifestGeneration.Test_EventSource_EtwManifestGenerationRollover (#90198)
上级 41bc9351
......@@ -143,9 +143,18 @@ private bool VerifyManifestAndRemoveFile(string fileName)
ETWTraceEventSource source = new ETWTraceEventSource(fileName);
Dictionary<string, int> providers = new Dictionary<string, int>();
int eventCount = 0;
var sawManifestData = false;
source.Dynamic.All += (eventData) =>
{
eventCount++;
if (!providers.ContainsKey(eventData.ProviderName))
{
providers[eventData.ProviderName] = 0;
}
providers[eventData.ProviderName]++;
if (eventData.ProviderName.Equals("SimpleEventSource") && eventData.EventName.Equals("ManifestData"))
{
sawManifestData = true;
......@@ -153,6 +162,18 @@ private bool VerifyManifestAndRemoveFile(string fileName)
};
source.Process();
//File.Delete(fileName);
if (!sawManifestData)
{
Console.WriteLine("Did not see ManifestData event from SimpleEventSource, test will fail. Additional info:");
Console.WriteLine($" file name {fileName}");
Console.WriteLine($" total event count {eventCount}");
Console.WriteLine($" total providers {providers.Count}");
foreach (var provider in providers.Keys)
{
Console.WriteLine($" Provider name {provider} event count {providers[provider]}");
}
}
return sawManifestData;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册