From beee8e040064775ca1846e56851c449306d7dae9 Mon Sep 17 00:00:00 2001 From: Vitalii Fedorchenko Date: Wed, 5 Jun 2024 13:25:23 +0300 Subject: [PATCH] CI: added some waits to fix WriteDescendingRollingFile --- test/NReco.Logging.Tests/FileProviderTests.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/NReco.Logging.Tests/FileProviderTests.cs b/test/NReco.Logging.Tests/FileProviderTests.cs index c1a0742..2ddb9bc 100644 --- a/test/NReco.Logging.Tests/FileProviderTests.cs +++ b/test/NReco.Logging.Tests/FileProviderTests.cs @@ -223,6 +223,9 @@ public void WriteDescendingRollingFile() { createFactoryAndTestLogger(); for (int i = 0; i < 1000; i++) { logger.LogInformation("TEST 0123456789"); + if (i % 50 == 0) { + System.Threading.Thread.Sleep(20); // give some time for log writer to handle the queue + } } factory.Dispose(); Assert.Equal(5, Directory.GetFiles(tmpFileDir, "test*.log").Length);