mirror of
https://github.com/opensim/opensim.git
synced 2026-08-13 05:05:43 +08:00
* Another attempt at fixing the random spurious test error.
* This time it might be the listening socket thread from HttpServer aborting with a non blocking thread abort exception. Hopefully calling Stop() on MainServer.Instance will solve that.
This commit is contained in:
@@ -330,5 +330,16 @@ namespace OpenSim.Framework.Communications.Tests
|
||||
Assert.That(rootFolder.RequestListOfFolders(), Is.Empty);
|
||||
Assert.That(myScene.InventoryService.GetFolder(myFolder), Is.Null);
|
||||
}
|
||||
|
||||
[TearDown]
|
||||
public void TearDown()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (MainServer.Instance != null) MainServer.Instance.Stop();
|
||||
}
|
||||
catch (System.NullReferenceException)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -362,6 +362,16 @@ namespace OpenSim.Framework.Communications.Tests
|
||||
//Console.WriteLine("Finished T023_TestAuthenticatedLoginAlreadyLoggedIn()");
|
||||
}
|
||||
|
||||
[TearDown]
|
||||
public void TearDown()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (MainServer.Instance != null) MainServer.Instance.Stop();
|
||||
} catch (NullReferenceException)
|
||||
{}
|
||||
}
|
||||
|
||||
public class TestLoginToRegionConnector : ILoginServiceToRegionsConnector
|
||||
{
|
||||
private List<RegionInfo> m_regionsList = new List<RegionInfo>();
|
||||
|
||||
@@ -1637,13 +1637,20 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
public void Stop()
|
||||
{
|
||||
HTTPDRunning = false;
|
||||
m_httpListener2.ExceptionThrown -= httpServerException;
|
||||
//m_httpListener2.DisconnectHandler = null;
|
||||
|
||||
m_httpListener2.LogWriter = null;
|
||||
m_httpListener2.RequestReceived -= OnRequest;
|
||||
try
|
||||
{
|
||||
m_httpListener2.ExceptionThrown -= httpServerException;
|
||||
//m_httpListener2.DisconnectHandler = null;
|
||||
|
||||
m_httpListener2.Stop();
|
||||
m_httpListener2.LogWriter = null;
|
||||
m_httpListener2.RequestReceived -= OnRequest;
|
||||
m_httpListener2.Stop();
|
||||
}
|
||||
catch (NullReferenceException)
|
||||
{
|
||||
m_log.Warn("[BASEHTTPSERVER]: Null Reference when stopping HttpServer.");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void RemoveStreamHandler(string httpMethod, string path)
|
||||
|
||||
Reference in New Issue
Block a user