From 776936268705940bfb13d10d6b6824ef20eb99cb Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 7 Mar 2012 01:03:26 +0000 Subject: Always zero the PhysActor on dupes to prevent side effects on the orignal prim --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 65905a0..439b718 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -1546,10 +1546,7 @@ namespace OpenSim.Region.Framework.Scenes if (userExposed) dupe.UUID = UUID.Random(); - //memberwiseclone means it also clones the physics actor reference - // This will make physical prim 'bounce' if not set to null. - if (!userExposed) - dupe.PhysActor = null; + dupe.PhysActor = null; dupe.OwnerID = AgentID; dupe.GroupID = GroupID; -- 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/Common/Mock/MockRegionDataPlugin.cs | 22 +++++++++++----------- OpenSim/Tests/Torture/NPCTortureTests.cs | 7 ++++--- OpenSim/Tests/Torture/ObjectTortureTests.cs | 15 +++++++++------ OpenSim/Tests/Torture/ScriptTortureTests.cs | 1 + 4 files changed, 25 insertions(+), 20 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs b/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs index 79bb9c2..295e868 100644 --- a/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs @@ -177,9 +177,9 @@ namespace OpenSim.Data.Null // Therefore, we need to store parts rather than groups. foreach (SceneObjectPart prim in obj.Parts) { - m_log.DebugFormat( - "[MOCK REGION DATA PLUGIN]: Storing part {0} {1} in object {2} {3} in region {4}", - prim.Name, prim.UUID, obj.Name, obj.UUID, regionUUID); +// m_log.DebugFormat( +// "[MOCK REGION DATA PLUGIN]: Storing part {0} {1} in object {2} {3} in region {4}", +// prim.Name, prim.UUID, obj.Name, obj.UUID, regionUUID); m_sceneObjectParts[prim.UUID] = prim; } @@ -193,9 +193,9 @@ namespace OpenSim.Data.Null { if (part.ParentGroup.UUID == obj) { - m_log.DebugFormat( - "[MOCK REGION DATA PLUGIN]: Removing part {0} {1} as part of object {2} from {3}", - part.Name, part.UUID, obj, regionUUID); +// m_log.DebugFormat( +// "[MOCK REGION DATA PLUGIN]: Removing part {0} {1} as part of object {2} from {3}", +// part.Name, part.UUID, obj, regionUUID); m_sceneObjectParts.Remove(part.UUID); } } @@ -215,8 +215,8 @@ namespace OpenSim.Data.Null { if (prim.IsRoot) { - m_log.DebugFormat( - "[MOCK REGION DATA PLUGIN]: Loading root part {0} {1} in {2}", prim.Name, prim.UUID, regionUUID); +// m_log.DebugFormat( +// "[MOCK REGION DATA PLUGIN]: Loading root part {0} {1} in {2}", prim.Name, prim.UUID, regionUUID); objects[prim.UUID] = new SceneObjectGroup(prim); } } @@ -240,9 +240,9 @@ namespace OpenSim.Data.Null } else { - m_log.WarnFormat( - "[MOCK REGION DATA PLUGIN]: Database contains an orphan child prim {0} {1} in region {2} pointing to missing parent {3}. This prim will not be loaded.", - prim.Name, prim.UUID, regionUUID, prim.ParentUUID); +// m_log.WarnFormat( +// "[MOCK REGION DATA PLUGIN]: Database contains an orphan child prim {0} {1} in region {2} pointing to missing parent {3}. This prim will not be loaded.", +// prim.Name, prim.UUID, regionUUID, prim.ParentUUID); } } } 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