diff --git a/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsManifestGeneration.Etw.cs b/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsManifestGeneration.Etw.cs index 4fd7f3e928ec7..bbe134bda23ae 100644 --- a/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsManifestGeneration.Etw.cs +++ b/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsManifestGeneration.Etw.cs @@ -54,6 +54,11 @@ public void Test_EventSource_EtwManifestGeneration() 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 @@ public void Test_EventSource_EtwManifestGenerationRollover() 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));