From d0744f8eca6adc2b6ae257f581792bd8eae16ea2 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Tue, 14 Apr 2009 18:49:45 +0000 Subject: * Make archiver tests pump the asset server manually instead of starting the normal runtime thread * This may eliminate the occasional archive test freezes, since they appeared to occur when somehow the asset server didn't pick up on the presence of a request in the asset quque --- .../Tests/Common/Mock/TestCommunicationsManager.cs | 11 +++++-- OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs | 38 ++++++++++++++++++++-- 2 files changed, 45 insertions(+), 4 deletions(-) (limited to 'OpenSim/Tests') diff --git a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs b/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs index 3b39d36..93891c0 100644 --- a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs +++ b/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs @@ -60,8 +60,7 @@ namespace OpenSim.Tests.Common.Mock m_inventoryDataPlugin = new TestInventoryDataPlugin(); SQLAssetServer assetService = new SQLAssetServer(new TestAssetDataPlugin()); - m_assetCache = new AssetCache(assetService); - m_assetCache.AssetServer.Start(); + m_assetCache = new AssetCache(assetService); LocalInventoryService lis = new LocalInventoryService(); lis.AddPlugin(m_inventoryDataPlugin); @@ -76,5 +75,13 @@ namespace OpenSim.Tests.Common.Mock LocalBackEndServices gs = new LocalBackEndServices(); m_gridService = gs; } + + /// + /// Start services that take care of business using their own threads. + /// + public void StartServices() + { + m_assetCache.AssetServer.Start(); + } } } diff --git a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs index 3bcd949..ea4f0af 100644 --- a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs +++ b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs @@ -52,10 +52,39 @@ namespace OpenSim.Tests.Common.Setup /// /// Set up a test scene /// + /// + /// Automatically starts service threads, as would the normal runtime. + /// /// public static TestScene SetupScene() { - return SetupScene("Unit test region", UUID.Random(), 1000, 1000, new TestCommunicationsManager()); + return SetupScene(true); + } + + /// + /// Set up a test scene + /// + /// + /// Start associated service threads for the scene + /// + public static TestScene SetupScene(bool startServices) + { + return SetupScene( + "Unit test region", UUID.Random(), 1000, 1000, new TestCommunicationsManager(), startServices); + } + + /// + /// Set up a test scene + /// + /// Name of the region + /// ID of the region + /// X co-ordinate of the region + /// Y co-ordinate of the region + /// This should be the same if simulating two scenes within a standalone + /// + public static TestScene SetupScene(string name, UUID id, uint x, uint y, TestCommunicationsManager cm) + { + return SetupScene(name, id, x, y, cm, true); } /// @@ -66,8 +95,10 @@ namespace OpenSim.Tests.Common.Setup /// X co-ordinate of the region /// Y co-ordinate of the region /// This should be the same if simulating two scenes within a standalone + /// Start associated threads for the services used by the scene /// - public static TestScene SetupScene(string name, UUID id, uint x, uint y, CommunicationsManager cm) + public static TestScene SetupScene( + string name, UUID id, uint x, uint y, TestCommunicationsManager cm, bool startServices) { Console.WriteLine("Setting up test scene {0}", name); @@ -102,6 +133,9 @@ namespace OpenSim.Tests.Common.Setup testScene.PhysicsScene = physicsPluginManager.GetPhysicsScene("basicphysics", "ZeroMesher", configSource, "test"); + if (startServices) + cm.StartServices(); + return testScene; } -- cgit v1.1