From 014e9e2c6d7ff53bb6f511e7ece9a1e2685663a0 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Tue, 17 Feb 2009 16:25:59 +0000 Subject: [PATCH] * Get rid of a unit test race condition based on my misreading of the AutoResetEvent docs * Hopefully this will reduce the spike in build failures seen in the past few days (since I introduced an addition oar test) --- .../CoreModules/World/Archiver/Tests/ArchiverTests.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs index c49a1f6a99..25fffc475d 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs @@ -43,11 +43,11 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests [TestFixture] public class ArchiverTests { - private EventWaitHandle m_waitHandle = new AutoResetEvent(false); + private EventWaitHandle m_waitHandle = new ManualResetEvent(false); private void SaveCompleted(string errorMessage) { - m_waitHandle.Set(); + m_waitHandle.Set(); } /// @@ -108,6 +108,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests scene.EventManager.OnOarFileSaved += SaveCompleted; archiverModule.ArchiveRegion(archiveWriteStream); m_waitHandle.WaitOne(60000, true); + m_waitHandle.Reset(); byte[] archive = archiveWriteStream.ToArray(); MemoryStream archiveReadStream = new MemoryStream(archive); @@ -252,6 +253,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests scene.EventManager.OnOarFileSaved += SaveCompleted; archiverModule.ArchiveRegion(archiveWriteStream); m_waitHandle.WaitOne(60000, true); + m_waitHandle.Reset(); } {