diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Tests/Torture/ObjectTortureTests.cs | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/OpenSim/Tests/Torture/ObjectTortureTests.cs b/OpenSim/Tests/Torture/ObjectTortureTests.cs index 74b336e..e83186a 100644 --- a/OpenSim/Tests/Torture/ObjectTortureTests.cs +++ b/OpenSim/Tests/Torture/ObjectTortureTests.cs | |||
@@ -49,6 +49,13 @@ namespace OpenSim.Tests.Torture | |||
49 | [TestFixture] | 49 | [TestFixture] |
50 | public class ObjectTortureTests | 50 | public class ObjectTortureTests |
51 | { | 51 | { |
52 | [TearDown] | ||
53 | public void TearDown() | ||
54 | { | ||
55 | GC.Collect(); | ||
56 | GC.WaitForPendingFinalizers(); | ||
57 | } | ||
58 | |||
52 | // [Test] | 59 | // [Test] |
53 | // public void Test0000Clean() | 60 | // public void Test0000Clean() |
54 | // { | 61 | // { |
@@ -141,8 +148,18 @@ namespace OpenSim.Tests.Torture | |||
141 | string.Format("Object {0} could not be retrieved", i)); | 148 | string.Format("Object {0} could not be retrieved", i)); |
142 | } | 149 | } |
143 | 150 | ||
144 | // This does not work to fire the SceneObjectGroup destructors - something else is hanging on to them. | 151 | // When a scene object is added to a scene, it is placed in the update list for sending to viewers |
145 | // scene.DeleteAllSceneObjects(); | 152 | // (though in this case we have none). When it is deleted, it is not removed from the update which is |
153 | // fine since it will later be ignored. | ||
154 | // | ||
155 | // However, that means that we need to manually run an update here to clear out that list so that deleted | ||
156 | // objects will be clean up by the garbage collector before the next stress test is run. | ||
157 | scene.Update(); | ||
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(); | ||
146 | 163 | ||
147 | Console.WriteLine( | 164 | Console.WriteLine( |
148 | "Took {0}ms, {1}MB ({2} - {3}) to create {4} objects each containing {5} prim(s)", | 165 | "Took {0}ms, {1}MB ({2} - {3}) to create {4} objects each containing {5} prim(s)", |