Index: Core/Common/test/Core.Common.Utils.Test/FileUtilsTest.cs =================================================================== diff -u -rce31448a066c084f755439f3e7d453bfb042b291 -r1c4e27d7463922b9baff2c5886a21735bf24b59e --- Core/Common/test/Core.Common.Utils.Test/FileUtilsTest.cs (.../FileUtilsTest.cs) (revision ce31448a066c084f755439f3e7d453bfb042b291) +++ Core/Common/test/Core.Common.Utils.Test/FileUtilsTest.cs (.../FileUtilsTest.cs) (revision 1c4e27d7463922b9baff2c5886a21735bf24b59e) @@ -21,6 +21,7 @@ using System; using System.IO; +using System.Threading; using Core.Common.TestUtil; using NUnit.Framework; @@ -193,7 +194,7 @@ Assert.AreEqual(message, exception.Message); Assert.IsInstanceOf(exception.InnerException); } - + [Test] public void DeleteOldFiles_ValidPathWithFile_DeletesFile() { @@ -203,10 +204,13 @@ using (new FileDisposeHelper(filePath)) { + Thread.Sleep(1); // Sleep 1 ms to make sure File.Create has had enough time to create the file. + // Call FileUtils.DeleteOldFiles(path, "*.log", 0); // Assert + Thread.Sleep(1); // Sleep 1 ms to make sure File.Delete has had enough time to remove the file. Assert.IsFalse(File.Exists(filePath)); } }