Fix TestsManifestGeneration tests (#46658)
authorSung Yoon Whang <suwhang@microsoft.com>
Thu, 7 Jan 2021 01:52:32 +0000 (17:52 -0800)
committerGitHub <noreply@github.com>
Thu, 7 Jan 2021 01:52:32 +0000 (17:52 -0800)
* Flush before checking for manifest data

* add comments

src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsManifestGeneration.Etw.cs

index 4fd7f3e..bbe134b 100644 (file)
@@ -54,6 +54,11 @@ namespace BasicEventSourceTests
                     Thread.Sleep(TimeSpan.FromSeconds(5));
 
                     tracesession.Flush();
+
+                    // Sleep after requesting flush to ensure that the manifest payload generated
+                    // is fully written to the etl file.
+                    Thread.Sleep(TimeSpan.FromSeconds(5));
+
                     tracesession.DisableProvider("SimpleEventSource");
                     tracesession.Dispose();
 
@@ -87,6 +92,10 @@ namespace BasicEventSourceTests
 
                     tracesession.Flush();
 
+                    // Sleep after requesting flush to ensure that the manifest payload generated
+                    // is fully written to the etl file.
+                    Thread.Sleep(TimeSpan.FromSeconds(5));
+
                     tracesession.SetFileName(rolloverFile);
 
                     Thread.Sleep(TimeSpan.FromSeconds(5));