From 78c469ffed1cde8f35118e71f27df1043797e61d Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 27 Aug 2024 16:27:15 -0500 Subject: [PATCH] added one second delay to SpectralWriterTest --- MetaMorpheus/Test/SpectralRecoveryTest.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/MetaMorpheus/Test/SpectralRecoveryTest.cs b/MetaMorpheus/Test/SpectralRecoveryTest.cs index 97be37afe..c69e03aa2 100644 --- a/MetaMorpheus/Test/SpectralRecoveryTest.cs +++ b/MetaMorpheus/Test/SpectralRecoveryTest.cs @@ -1,7 +1,8 @@ using EngineLayer; using EngineLayer.ClassicSearch; using MassSpectrometry; -using NUnit.Framework; using Assert = NUnit.Framework.Legacy.ClassicAssert; +using NUnit.Framework; +using Assert = NUnit.Framework.Legacy.ClassicAssert; using Proteomics; using Proteomics.ProteolyticDigestion; using System; @@ -17,6 +18,8 @@ using UsefulProteomicsDatabases; using Nett; using System.DirectoryServices; +using System.Threading.Tasks; +using System.Threading; namespace Test { @@ -377,6 +380,10 @@ public static void SpectralWriterTest() testLibraryWithoutDecoy = new SpectralLibrary(new List { Path.Combine(path, matchingvalue) }); Assert.That(testLibraryWithoutDecoy.TryGetSpectrum("EESGKPGAHVTVK", 2, out spectrum)); + // When writing a new spectral library, we don't want it to have the exact same name as the old one. + // So, we make sure at least one second has passed + Thread.Sleep(new TimeSpan(0, 0, 1)); // Wait for the library to close + // Test spectral library update postSearchTask.Parameters.SearchParameters.UpdateSpectralLibrary = true; postSearchTask.Parameters.SpectralLibrary = testLibraryWithoutDecoy;