diff options
author | Justin Clarke Casey | 2009-02-17 16:51:09 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2009-02-17 16:51:09 +0000 |
commit | 4e779bbd8129c8fb0b2c109ca2912265ca85c8a5 (patch) | |
tree | 3d805495ea0a58fcd1aba0c3b9eb11f5688f1733 /OpenSim/Region/CoreModules/Avatar/Inventory | |
parent | * Get rid of a unit test race condition based on my misreading of the AutoRes... (diff) | |
download | opensim-SC_OLD-4e779bbd8129c8fb0b2c109ca2912265ca85c8a5.zip opensim-SC_OLD-4e779bbd8129c8fb0b2c109ca2912265ca85c8a5.tar.gz opensim-SC_OLD-4e779bbd8129c8fb0b2c109ca2912265ca85c8a5.tar.bz2 opensim-SC_OLD-4e779bbd8129c8fb0b2c109ca2912265ca85c8a5.tar.xz |
* switch to pulsing monitors to perform test sync instead of events, since this doesn't allow one to accidentally forget to reset the event
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs index d1956b4..4e55f21 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs | |||
@@ -44,12 +44,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
44 | [TestFixture] | 44 | [TestFixture] |
45 | public class InventoryArchiverTests | 45 | public class InventoryArchiverTests |
46 | { | 46 | { |
47 | private EventWaitHandle m_waitHandle = new AutoResetEvent(false); | ||
48 | |||
49 | private void SaveCompleted( | 47 | private void SaveCompleted( |
50 | bool succeeded, CachedUserInfo userInfo, string invPath, Stream saveStream, Exception reportedException) | 48 | bool succeeded, CachedUserInfo userInfo, string invPath, Stream saveStream, Exception reportedException) |
51 | { | 49 | { |
52 | m_waitHandle.Set(); | 50 | lock (this) |
51 | { | ||
52 | Monitor.PulseAll(this); | ||
53 | } | ||
53 | } | 54 | } |
54 | 55 | ||
55 | /// <summary> | 56 | /// <summary> |
@@ -109,8 +110,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
109 | MemoryStream archiveWriteStream = new MemoryStream(); | 110 | MemoryStream archiveWriteStream = new MemoryStream(); |
110 | archiverModule.OnInventoryArchiveSaved += SaveCompleted; | 111 | archiverModule.OnInventoryArchiveSaved += SaveCompleted; |
111 | 112 | ||
112 | archiverModule.ArchiveInventory(userFirstName, userLastName, "Objects", archiveWriteStream); | 113 | archiverModule.ArchiveInventory(userFirstName, userLastName, "Objects", archiveWriteStream); |
113 | m_waitHandle.WaitOne(60000, true); | 114 | |
115 | lock (this) | ||
116 | { | ||
117 | archiverModule.ArchiveInventory(userFirstName, userLastName, "Objects", archiveWriteStream); | ||
118 | Monitor.Wait(this, 60000); | ||
119 | } | ||
114 | 120 | ||
115 | /* | 121 | /* |
116 | byte[] archive = archiveWriteStream.ToArray(); | 122 | byte[] archive = archiveWriteStream.ToArray(); |