From 1d0f67f512ee402b41d25c72739f4e6aab51410a Mon Sep 17 00:00:00 2001 From: Sung Yoon Whang Date: Wed, 6 Jan 2021 17:52:32 -0800 Subject: [PATCH] Fix TestsManifestGeneration tests (#46658) * Flush before checking for manifest data * add comments --- .../tests/BasicEventSourceTest/TestsManifestGeneration.Etw.cs | 9 +++++++++ 1 file changed, 9 insertions(+) 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 4fd7f3e..bbe134b 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 @@ 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)); -- 2.7.4