aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-03-07 00:31:18 +0000
committerJustin Clark-Casey (justincc)2012-03-07 00:31:18 +0000
commitf3678d217f7b1d69faf4aaeb0097348f3d7f91b6 (patch)
tree8b011b384366a99b7759f230abed9c4c26a4fbf9
parentAdd documentation to make more explicit the difference between OnRezScript an... (diff)
downloadopensim-SC_OLD-f3678d217f7b1d69faf4aaeb0097348f3d7f91b6.zip
opensim-SC_OLD-f3678d217f7b1d69faf4aaeb0097348f3d7f91b6.tar.gz
opensim-SC_OLD-f3678d217f7b1d69faf4aaeb0097348f3d7f91b6.tar.bz2
opensim-SC_OLD-f3678d217f7b1d69faf4aaeb0097348f3d7f91b6.tar.xz
Stop individually deleting objects at the end of each ObjectTortureTest.
We can now do this since the entire scene and all objects within it are now successfully gc'd at the end of these tests. This greatly improves the time taken to run each test (by reducing teardown time, not the time to actually do the test work that we're interested in). Slightly simplifies config read in Scene constructor to help facilitate this.
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs49
-rw-r--r--OpenSim/Tests/Common/Helpers/SceneHelpers.cs2
-rw-r--r--OpenSim/Tests/Torture/NPCTortureTests.cs4
-rw-r--r--OpenSim/Tests/Torture/ObjectTortureTests.cs8
-rw-r--r--OpenSim/Tests/Torture/ScriptTortureTests.cs8
5 files changed, 36 insertions, 35 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 6b28581..11e5ce3 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -628,10 +628,10 @@ namespace OpenSim.Region.Framework.Scenes
628 628
629 #region Region Config 629 #region Region Config
630 630
631 try 631 // Region config overrides global config
632 //
633 if (m_config.Configs["Startup"] != null)
632 { 634 {
633 // Region config overrides global config
634 //
635 IConfig startupConfig = m_config.Configs["Startup"]; 635 IConfig startupConfig = m_config.Configs["Startup"];
636 636
637 m_defaultDrawDistance = startupConfig.GetFloat("DefaultDrawDistance",m_defaultDrawDistance); 637 m_defaultDrawDistance = startupConfig.GetFloat("DefaultDrawDistance",m_defaultDrawDistance);
@@ -721,46 +721,39 @@ namespace OpenSim.Region.Framework.Scenes
721 m_update_terrain = startupConfig.GetInt( "UpdateTerrainEveryNFrames", m_update_terrain); 721 m_update_terrain = startupConfig.GetInt( "UpdateTerrainEveryNFrames", m_update_terrain);
722 m_update_temp_cleaning = startupConfig.GetInt( "UpdateTempCleaningEveryNFrames", m_update_temp_cleaning); 722 m_update_temp_cleaning = startupConfig.GetInt( "UpdateTempCleaningEveryNFrames", m_update_temp_cleaning);
723 } 723 }
724 catch
725 {
726 m_log.Warn("[SCENE]: Failed to load StartupConfig");
727 }
728 724
729 #endregion Region Config 725 #endregion Region Config
730 726
731 #region Interest Management 727 #region Interest Management
732 728
733 if (m_config != null) 729 IConfig interestConfig = m_config.Configs["InterestManagement"];
730 if (interestConfig != null)
734 { 731 {
735 IConfig interestConfig = m_config.Configs["InterestManagement"]; 732 string update_prioritization_scheme = interestConfig.GetString("UpdatePrioritizationScheme", "Time").Trim().ToLower();
736 if (interestConfig != null)
737 {
738 string update_prioritization_scheme = interestConfig.GetString("UpdatePrioritizationScheme", "Time").Trim().ToLower();
739
740 try
741 {
742 m_priorityScheme = (UpdatePrioritizationSchemes)Enum.Parse(typeof(UpdatePrioritizationSchemes), update_prioritization_scheme, true);
743 }
744 catch (Exception)
745 {
746 m_log.Warn("[PRIORITIZER]: UpdatePrioritizationScheme was not recognized, setting to default prioritizer Time");
747 m_priorityScheme = UpdatePrioritizationSchemes.Time;
748 }
749 733
750 m_reprioritizationEnabled = interestConfig.GetBoolean("ReprioritizationEnabled", true); 734 try
751 m_reprioritizationInterval = interestConfig.GetDouble("ReprioritizationInterval", 5000.0); 735 {
752 m_rootReprioritizationDistance = interestConfig.GetDouble("RootReprioritizationDistance", 10.0); 736 m_priorityScheme = (UpdatePrioritizationSchemes)Enum.Parse(typeof(UpdatePrioritizationSchemes), update_prioritization_scheme, true);
753 m_childReprioritizationDistance = interestConfig.GetDouble("ChildReprioritizationDistance", 20.0);
754 } 737 }
738 catch (Exception)
739 {
740 m_log.Warn("[PRIORITIZER]: UpdatePrioritizationScheme was not recognized, setting to default prioritizer Time");
741 m_priorityScheme = UpdatePrioritizationSchemes.Time;
742 }
743
744 m_reprioritizationEnabled = interestConfig.GetBoolean("ReprioritizationEnabled", true);
745 m_reprioritizationInterval = interestConfig.GetDouble("ReprioritizationInterval", 5000.0);
746 m_rootReprioritizationDistance = interestConfig.GetDouble("RootReprioritizationDistance", 10.0);
747 m_childReprioritizationDistance = interestConfig.GetDouble("ChildReprioritizationDistance", 20.0);
755 } 748 }
756 749
757 m_log.InfoFormat("[SCENE]: Using the {0} prioritization scheme", m_priorityScheme); 750 m_log.DebugFormat("[SCENE]: Using the {0} prioritization scheme", m_priorityScheme);
758 751
759 #endregion Interest Management 752 #endregion Interest Management
760 753
761 StatsReporter = new SimStatsReporter(this); 754 StatsReporter = new SimStatsReporter(this);
762 StatsReporter.OnSendStatsResult += SendSimStatsPackets; 755 StatsReporter.OnSendStatsResult += SendSimStatsPackets;
763 StatsReporter.OnStatsIncorrect += m_sceneGraph.RecalculateStats; 756 StatsReporter.OnStatsIncorrect += m_sceneGraph.RecalculateStats;
764 } 757 }
765 758
766 /// <summary> 759 /// <summary>
diff --git a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs
index 8a69d7c..7bf08ae 100644
--- a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs
+++ b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs
@@ -136,7 +136,7 @@ namespace OpenSim.Tests.Common
136 StartAuthenticationService(testScene); 136 StartAuthenticationService(testScene);
137 LocalInventoryServicesConnector inventoryService = StartInventoryService(testScene); 137 LocalInventoryServicesConnector inventoryService = StartInventoryService(testScene);
138 StartGridService(testScene); 138 StartGridService(testScene);
139 LocalUserAccountServicesConnector userAccountService = StartUserAccountService(testScene); 139 LocalUserAccountServicesConnector userAccountService = StartUserAccountService(testScene);
140 LocalPresenceServicesConnector presenceService = StartPresenceService(testScene); 140 LocalPresenceServicesConnector presenceService = StartPresenceService(testScene);
141 141
142 inventoryService.PostInitialise(); 142 inventoryService.PostInitialise();
diff --git a/OpenSim/Tests/Torture/NPCTortureTests.cs b/OpenSim/Tests/Torture/NPCTortureTests.cs
index 8078d9d..65732db 100644
--- a/OpenSim/Tests/Torture/NPCTortureTests.cs
+++ b/OpenSim/Tests/Torture/NPCTortureTests.cs
@@ -75,6 +75,10 @@ namespace OpenSim.Tests.Torture
75 [TestFixtureTearDown] 75 [TestFixtureTearDown]
76 public void TearDown() 76 public void TearDown()
77 { 77 {
78 scene.Close();
79 GC.Collect();
80 GC.WaitForPendingFinalizers();
81
78 // We must set this back afterwards, otherwise later tests will fail since they're expecting multiple 82 // We must set this back afterwards, otherwise later tests will fail since they're expecting multiple
79 // threads. Possibly, later tests should be rewritten not to worry about such things. 83 // threads. Possibly, later tests should be rewritten not to worry about such things.
80 Util.FireAndForgetMethod = Util.DefaultFireAndForgetMethod; 84 Util.FireAndForgetMethod = Util.DefaultFireAndForgetMethod;
diff --git a/OpenSim/Tests/Torture/ObjectTortureTests.cs b/OpenSim/Tests/Torture/ObjectTortureTests.cs
index e83186a..7e9946b 100644
--- a/OpenSim/Tests/Torture/ObjectTortureTests.cs
+++ b/OpenSim/Tests/Torture/ObjectTortureTests.cs
@@ -156,11 +156,6 @@ namespace OpenSim.Tests.Torture
156 // objects will be clean up by the garbage collector before the next stress test is run. 156 // objects will be clean up by the garbage collector before the next stress test is run.
157 scene.Update(); 157 scene.Update();
158 158
159 // Currently, we need to do this in order to garbage collect the scene objects ready for the next test run.
160 // However, what we really need to do is find out why the entire scene is not garbage collected in
161 // teardown.
162 scene.DeleteAllSceneObjects();
163
164 Console.WriteLine( 159 Console.WriteLine(
165 "Took {0}ms, {1}MB ({2} - {3}) to create {4} objects each containing {5} prim(s)", 160 "Took {0}ms, {1}MB ({2} - {3}) to create {4} objects each containing {5} prim(s)",
166 Math.Round(elapsed.TotalMilliseconds), 161 Math.Round(elapsed.TotalMilliseconds),
@@ -170,7 +165,8 @@ namespace OpenSim.Tests.Torture
170 objectsToAdd, 165 objectsToAdd,
171 primsInEachObject); 166 primsInEachObject);
172 167
173 scene = null; 168 scene.Close();
169// scene = null;
174 } 170 }
175 } 171 }
176} \ No newline at end of file 172} \ No newline at end of file
diff --git a/OpenSim/Tests/Torture/ScriptTortureTests.cs b/OpenSim/Tests/Torture/ScriptTortureTests.cs
index d94bbde..87932cb 100644
--- a/OpenSim/Tests/Torture/ScriptTortureTests.cs
+++ b/OpenSim/Tests/Torture/ScriptTortureTests.cs
@@ -91,6 +91,14 @@ namespace OpenSim.Tests.Torture
91 m_scene.StartScripts(); 91 m_scene.StartScripts();
92 } 92 }
93 93
94 [TearDown]
95 public void TearDown()
96 {
97 m_scene.Close();
98 GC.Collect();
99 GC.WaitForPendingFinalizers();
100 }
101
94 [Test] 102 [Test]
95 public void TestCompileAndStart100Scripts() 103 public void TestCompileAndStart100Scripts()
96 { 104 {