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.
0.7.4.1
Justin Clark-Casey (justincc) 2012-03-07 00:31:18 +00:00
parent 23aba007dd
commit f3678d217f
5 changed files with 36 additions and 35 deletions

View File

@ -628,10 +628,10 @@ namespace OpenSim.Region.Framework.Scenes
#region Region Config
try
{
// Region config overrides global config
//
if (m_config.Configs["Startup"] != null)
{
IConfig startupConfig = m_config.Configs["Startup"];
m_defaultDrawDistance = startupConfig.GetFloat("DefaultDrawDistance",m_defaultDrawDistance);
@ -721,17 +721,11 @@ namespace OpenSim.Region.Framework.Scenes
m_update_terrain = startupConfig.GetInt( "UpdateTerrainEveryNFrames", m_update_terrain);
m_update_temp_cleaning = startupConfig.GetInt( "UpdateTempCleaningEveryNFrames", m_update_temp_cleaning);
}
catch
{
m_log.Warn("[SCENE]: Failed to load StartupConfig");
}
#endregion Region Config
#region Interest Management
if (m_config != null)
{
IConfig interestConfig = m_config.Configs["InterestManagement"];
if (interestConfig != null)
{
@ -752,9 +746,8 @@ namespace OpenSim.Region.Framework.Scenes
m_rootReprioritizationDistance = interestConfig.GetDouble("RootReprioritizationDistance", 10.0);
m_childReprioritizationDistance = interestConfig.GetDouble("ChildReprioritizationDistance", 20.0);
}
}
m_log.InfoFormat("[SCENE]: Using the {0} prioritization scheme", m_priorityScheme);
m_log.DebugFormat("[SCENE]: Using the {0} prioritization scheme", m_priorityScheme);
#endregion Interest Management

View File

@ -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;

View File

@ -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;
}
}
}

View File

@ -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()
{