From f3678d217f7b1d69faf4aaeb0097348f3d7f91b6 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 7 Mar 2012 00:31:18 +0000 Subject: 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. --- OpenSim/Tests/Torture/NPCTortureTests.cs | 4 ++++ OpenSim/Tests/Torture/ObjectTortureTests.cs | 8 ++------ OpenSim/Tests/Torture/ScriptTortureTests.cs | 8 ++++++++ 3 files changed, 14 insertions(+), 6 deletions(-) (limited to 'OpenSim/Tests/Torture') 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 [TestFixtureTearDown] public void TearDown() { + scene.Close(); + GC.Collect(); + GC.WaitForPendingFinalizers(); + // We must set this back afterwards, otherwise later tests will fail since they're expecting multiple // threads. Possibly, later tests should be rewritten not to worry about such things. 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 // objects will be clean up by the garbage collector before the next stress test is run. scene.Update(); - // Currently, we need to do this in order to garbage collect the scene objects ready for the next test run. - // However, what we really need to do is find out why the entire scene is not garbage collected in - // teardown. - scene.DeleteAllSceneObjects(); - Console.WriteLine( "Took {0}ms, {1}MB ({2} - {3}) to create {4} objects each containing {5} prim(s)", Math.Round(elapsed.TotalMilliseconds), @@ -170,7 +165,8 @@ namespace OpenSim.Tests.Torture objectsToAdd, primsInEachObject); - scene = null; + scene.Close(); +// scene = null; } } } \ 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 m_scene.StartScripts(); } + [TearDown] + public void TearDown() + { + m_scene.Close(); + GC.Collect(); + GC.WaitForPendingFinalizers(); + } + [Test] public void TestCompileAndStart100Scripts() { -- cgit v1.1 From 6bdea15ecf6fdaaf705704dddf9199b882675963 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 7 Mar 2012 01:11:37 +0000 Subject: minor: make NPC tests run in a given order, comment out log lines in mock region data plugins, null out scene in script and npc torture tests, add other doc comments to torture tests --- OpenSim/Tests/Torture/NPCTortureTests.cs | 7 ++++--- OpenSim/Tests/Torture/ObjectTortureTests.cs | 15 +++++++++------ OpenSim/Tests/Torture/ScriptTortureTests.cs | 1 + 3 files changed, 14 insertions(+), 9 deletions(-) (limited to 'OpenSim/Tests/Torture') diff --git a/OpenSim/Tests/Torture/NPCTortureTests.cs b/OpenSim/Tests/Torture/NPCTortureTests.cs index 65732db..0224505 100644 --- a/OpenSim/Tests/Torture/NPCTortureTests.cs +++ b/OpenSim/Tests/Torture/NPCTortureTests.cs @@ -76,6 +76,7 @@ namespace OpenSim.Tests.Torture public void TearDown() { scene.Close(); + scene = null; GC.Collect(); GC.WaitForPendingFinalizers(); @@ -102,7 +103,7 @@ namespace OpenSim.Tests.Torture } [Test] - public void TestAddRemove100NPCs() + public void Test_0001_AddRemove100NPCs() { TestHelpers.InMethod(); // log4net.Config.XmlConfigurator.Configure(); @@ -111,7 +112,7 @@ namespace OpenSim.Tests.Torture } [Test] - public void TestAddRemove1000NPCs() + public void Test_0002_AddRemove1000NPCs() { TestHelpers.InMethod(); // log4net.Config.XmlConfigurator.Configure(); @@ -120,7 +121,7 @@ namespace OpenSim.Tests.Torture } [Test] - public void TestAddRemove2000NPCs() + public void Test_0003_AddRemove2000NPCs() { TestHelpers.InMethod(); // log4net.Config.XmlConfigurator.Configure(); diff --git a/OpenSim/Tests/Torture/ObjectTortureTests.cs b/OpenSim/Tests/Torture/ObjectTortureTests.cs index 7e9946b..978a308 100644 --- a/OpenSim/Tests/Torture/ObjectTortureTests.cs +++ b/OpenSim/Tests/Torture/ObjectTortureTests.cs @@ -66,7 +66,7 @@ namespace OpenSim.Tests.Torture // } [Test] - public void Test0001_10K_1PrimObjects() + public void Test_0001_10K_1PrimObjects() { TestHelpers.InMethod(); // log4net.Config.XmlConfigurator.Configure(); @@ -75,7 +75,7 @@ namespace OpenSim.Tests.Torture } [Test] - public void Test0002_100K_1PrimObjects() + public void Test_0002_100K_1PrimObjects() { TestHelpers.InMethod(); // log4net.Config.XmlConfigurator.Configure(); @@ -84,7 +84,7 @@ namespace OpenSim.Tests.Torture } [Test] - public void Test0003_200K_1PrimObjects() + public void Test_0003_200K_1PrimObjects() { TestHelpers.InMethod(); // log4net.Config.XmlConfigurator.Configure(); @@ -93,7 +93,7 @@ namespace OpenSim.Tests.Torture } [Test] - public void Test0011_100_100PrimObjects() + public void Test_0011_100_100PrimObjects() { TestHelpers.InMethod(); // log4net.Config.XmlConfigurator.Configure(); @@ -102,7 +102,7 @@ namespace OpenSim.Tests.Torture } [Test] - public void Test0012_1K_100PrimObjects() + public void Test_0012_1K_100PrimObjects() { TestHelpers.InMethod(); // log4net.Config.XmlConfigurator.Configure(); @@ -111,7 +111,7 @@ namespace OpenSim.Tests.Torture } [Test] - public void Test0013_2K_100PrimObjects() + public void Test_0013_2K_100PrimObjects() { TestHelpers.InMethod(); // log4net.Config.XmlConfigurator.Configure(); @@ -123,6 +123,9 @@ namespace OpenSim.Tests.Torture { UUID ownerId = new UUID("F0000000-0000-0000-0000-000000000000"); + // Using a local variable for scene, at least on mono 2.6.7, means that it's much more likely to be garbage + // collected when we teardown this test. If it's done in a member variable, even if that is subsequently + // nulled out, the garbage collect can be delayed. TestScene scene = SceneHelpers.SetupScene(); // Process process = Process.GetCurrentProcess(); diff --git a/OpenSim/Tests/Torture/ScriptTortureTests.cs b/OpenSim/Tests/Torture/ScriptTortureTests.cs index 87932cb..2ef55b3 100644 --- a/OpenSim/Tests/Torture/ScriptTortureTests.cs +++ b/OpenSim/Tests/Torture/ScriptTortureTests.cs @@ -95,6 +95,7 @@ namespace OpenSim.Tests.Torture public void TearDown() { m_scene.Close(); + m_scene = null; GC.Collect(); GC.WaitForPendingFinalizers(); } -- cgit v1.1 From 30b2a8c778d02926e038bc62977c4a4c9dbec5ee Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 20 Mar 2012 23:12:21 +0000 Subject: Move frame loop entirely within Scene.Update() for better future performance analysis and stat accuracy. Update() now accepts a frames parameter which can control the number of frames updated. -1 will update until shutdown. The watchdog updating moves above the maintc recalculation for any required sleep since it should be accounted for within the frame. --- OpenSim/Tests/Torture/ObjectTortureTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests/Torture') diff --git a/OpenSim/Tests/Torture/ObjectTortureTests.cs b/OpenSim/Tests/Torture/ObjectTortureTests.cs index 978a308..d0d2199 100644 --- a/OpenSim/Tests/Torture/ObjectTortureTests.cs +++ b/OpenSim/Tests/Torture/ObjectTortureTests.cs @@ -157,7 +157,7 @@ namespace OpenSim.Tests.Torture // // However, that means that we need to manually run an update here to clear out that list so that deleted // objects will be clean up by the garbage collector before the next stress test is run. - scene.Update(); + scene.Update(1); Console.WriteLine( "Took {0}ms, {1}MB ({2} - {3}) to create {4} objects each containing {5} prim(s)", -- cgit v1.1