aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Tests/Torture
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Tests/Torture')
-rw-r--r--OpenSim/Tests/Torture/NPCTortureTests.cs11
-rw-r--r--OpenSim/Tests/Torture/ObjectTortureTests.cs23
-rw-r--r--OpenSim/Tests/Torture/ScriptTortureTests.cs9
3 files changed, 28 insertions, 15 deletions
diff --git a/OpenSim/Tests/Torture/NPCTortureTests.cs b/OpenSim/Tests/Torture/NPCTortureTests.cs
index 8078d9d..0224505 100644
--- a/OpenSim/Tests/Torture/NPCTortureTests.cs
+++ b/OpenSim/Tests/Torture/NPCTortureTests.cs
@@ -75,6 +75,11 @@ namespace OpenSim.Tests.Torture
75 [TestFixtureTearDown] 75 [TestFixtureTearDown]
76 public void TearDown() 76 public void TearDown()
77 { 77 {
78 scene.Close();
79 scene = null;
80 GC.Collect();
81 GC.WaitForPendingFinalizers();
82
78 // We must set this back afterwards, otherwise later tests will fail since they're expecting multiple 83 // 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. 84 // threads. Possibly, later tests should be rewritten not to worry about such things.
80 Util.FireAndForgetMethod = Util.DefaultFireAndForgetMethod; 85 Util.FireAndForgetMethod = Util.DefaultFireAndForgetMethod;
@@ -98,7 +103,7 @@ namespace OpenSim.Tests.Torture
98 } 103 }
99 104
100 [Test] 105 [Test]
101 public void TestAddRemove100NPCs() 106 public void Test_0001_AddRemove100NPCs()
102 { 107 {
103 TestHelpers.InMethod(); 108 TestHelpers.InMethod();
104// log4net.Config.XmlConfigurator.Configure(); 109// log4net.Config.XmlConfigurator.Configure();
@@ -107,7 +112,7 @@ namespace OpenSim.Tests.Torture
107 } 112 }
108 113
109 [Test] 114 [Test]
110 public void TestAddRemove1000NPCs() 115 public void Test_0002_AddRemove1000NPCs()
111 { 116 {
112 TestHelpers.InMethod(); 117 TestHelpers.InMethod();
113// log4net.Config.XmlConfigurator.Configure(); 118// log4net.Config.XmlConfigurator.Configure();
@@ -116,7 +121,7 @@ namespace OpenSim.Tests.Torture
116 } 121 }
117 122
118 [Test] 123 [Test]
119 public void TestAddRemove2000NPCs() 124 public void Test_0003_AddRemove2000NPCs()
120 { 125 {
121 TestHelpers.InMethod(); 126 TestHelpers.InMethod();
122// log4net.Config.XmlConfigurator.Configure(); 127// log4net.Config.XmlConfigurator.Configure();
diff --git a/OpenSim/Tests/Torture/ObjectTortureTests.cs b/OpenSim/Tests/Torture/ObjectTortureTests.cs
index e83186a..978a308 100644
--- a/OpenSim/Tests/Torture/ObjectTortureTests.cs
+++ b/OpenSim/Tests/Torture/ObjectTortureTests.cs
@@ -66,7 +66,7 @@ namespace OpenSim.Tests.Torture
66// } 66// }
67 67
68 [Test] 68 [Test]
69 public void Test0001_10K_1PrimObjects() 69 public void Test_0001_10K_1PrimObjects()
70 { 70 {
71 TestHelpers.InMethod(); 71 TestHelpers.InMethod();
72// log4net.Config.XmlConfigurator.Configure(); 72// log4net.Config.XmlConfigurator.Configure();
@@ -75,7 +75,7 @@ namespace OpenSim.Tests.Torture
75 } 75 }
76 76
77 [Test] 77 [Test]
78 public void Test0002_100K_1PrimObjects() 78 public void Test_0002_100K_1PrimObjects()
79 { 79 {
80 TestHelpers.InMethod(); 80 TestHelpers.InMethod();
81// log4net.Config.XmlConfigurator.Configure(); 81// log4net.Config.XmlConfigurator.Configure();
@@ -84,7 +84,7 @@ namespace OpenSim.Tests.Torture
84 } 84 }
85 85
86 [Test] 86 [Test]
87 public void Test0003_200K_1PrimObjects() 87 public void Test_0003_200K_1PrimObjects()
88 { 88 {
89 TestHelpers.InMethod(); 89 TestHelpers.InMethod();
90// log4net.Config.XmlConfigurator.Configure(); 90// log4net.Config.XmlConfigurator.Configure();
@@ -93,7 +93,7 @@ namespace OpenSim.Tests.Torture
93 } 93 }
94 94
95 [Test] 95 [Test]
96 public void Test0011_100_100PrimObjects() 96 public void Test_0011_100_100PrimObjects()
97 { 97 {
98 TestHelpers.InMethod(); 98 TestHelpers.InMethod();
99// log4net.Config.XmlConfigurator.Configure(); 99// log4net.Config.XmlConfigurator.Configure();
@@ -102,7 +102,7 @@ namespace OpenSim.Tests.Torture
102 } 102 }
103 103
104 [Test] 104 [Test]
105 public void Test0012_1K_100PrimObjects() 105 public void Test_0012_1K_100PrimObjects()
106 { 106 {
107 TestHelpers.InMethod(); 107 TestHelpers.InMethod();
108// log4net.Config.XmlConfigurator.Configure(); 108// log4net.Config.XmlConfigurator.Configure();
@@ -111,7 +111,7 @@ namespace OpenSim.Tests.Torture
111 } 111 }
112 112
113 [Test] 113 [Test]
114 public void Test0013_2K_100PrimObjects() 114 public void Test_0013_2K_100PrimObjects()
115 { 115 {
116 TestHelpers.InMethod(); 116 TestHelpers.InMethod();
117// log4net.Config.XmlConfigurator.Configure(); 117// log4net.Config.XmlConfigurator.Configure();
@@ -123,6 +123,9 @@ namespace OpenSim.Tests.Torture
123 { 123 {
124 UUID ownerId = new UUID("F0000000-0000-0000-0000-000000000000"); 124 UUID ownerId = new UUID("F0000000-0000-0000-0000-000000000000");
125 125
126 // Using a local variable for scene, at least on mono 2.6.7, means that it's much more likely to be garbage
127 // collected when we teardown this test. If it's done in a member variable, even if that is subsequently
128 // nulled out, the garbage collect can be delayed.
126 TestScene scene = SceneHelpers.SetupScene(); 129 TestScene scene = SceneHelpers.SetupScene();
127 130
128// Process process = Process.GetCurrentProcess(); 131// Process process = Process.GetCurrentProcess();
@@ -156,11 +159,6 @@ namespace OpenSim.Tests.Torture
156 // objects will be clean up by the garbage collector before the next stress test is run. 159 // objects will be clean up by the garbage collector before the next stress test is run.
157 scene.Update(); 160 scene.Update();
158 161
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( 162 Console.WriteLine(
165 "Took {0}ms, {1}MB ({2} - {3}) to create {4} objects each containing {5} prim(s)", 163 "Took {0}ms, {1}MB ({2} - {3}) to create {4} objects each containing {5} prim(s)",
166 Math.Round(elapsed.TotalMilliseconds), 164 Math.Round(elapsed.TotalMilliseconds),
@@ -170,7 +168,8 @@ namespace OpenSim.Tests.Torture
170 objectsToAdd, 168 objectsToAdd,
171 primsInEachObject); 169 primsInEachObject);
172 170
173 scene = null; 171 scene.Close();
172// scene = null;
174 } 173 }
175 } 174 }
176} \ No newline at end of file 175} \ No newline at end of file
diff --git a/OpenSim/Tests/Torture/ScriptTortureTests.cs b/OpenSim/Tests/Torture/ScriptTortureTests.cs
index d94bbde..2ef55b3 100644
--- a/OpenSim/Tests/Torture/ScriptTortureTests.cs
+++ b/OpenSim/Tests/Torture/ScriptTortureTests.cs
@@ -91,6 +91,15 @@ 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 m_scene = null;
99 GC.Collect();
100 GC.WaitForPendingFinalizers();
101 }
102
94 [Test] 103 [Test]
95 public void TestCompileAndStart100Scripts() 104 public void TestCompileAndStart100Scripts()
96 { 105 {