Skip to content

Commit

Permalink
added one second delay to SpectralWriterTest
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander-Sol committed Aug 27, 2024
1 parent 10c9e78 commit 78c469f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion MetaMorpheus/Test/SpectralRecoveryTest.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -17,6 +18,8 @@
using UsefulProteomicsDatabases;
using Nett;
using System.DirectoryServices;
using System.Threading.Tasks;
using System.Threading;

namespace Test
{
Expand Down Expand Up @@ -377,6 +380,10 @@ public static void SpectralWriterTest()
testLibraryWithoutDecoy = new SpectralLibrary(new List<string> { 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;
Expand Down

0 comments on commit 78c469f

Please sign in to comment.