mirror of
https://github.com/opensim/opensim.git
synced 2026-08-04 16:22:50 +08:00
Deal with possible race in TestAddNeighborRegion in ScenePresenceTests
This commit is contained in:
@@ -147,7 +147,13 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||
TestHelper.InMethod();
|
||||
|
||||
string reason;
|
||||
|
||||
if (acd1 == null)
|
||||
fixNullPresence();
|
||||
|
||||
scene.NewUserConnection(acd1, out reason);
|
||||
if (testclient == null)
|
||||
testclient = new TestClient(acd1, scene);
|
||||
scene.AddNewClient(testclient);
|
||||
|
||||
ScenePresence presence = scene.GetScenePresence(agent1);
|
||||
@@ -162,6 +168,24 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||
|
||||
Assert.That(neighbours.Count, Is.EqualTo(2));
|
||||
}
|
||||
public void fixNullPresence()
|
||||
{
|
||||
string firstName = "testfirstname";
|
||||
|
||||
AgentCircuitData agent = new AgentCircuitData();
|
||||
agent.AgentID = agent1;
|
||||
agent.firstname = firstName;
|
||||
agent.lastname = "testlastname";
|
||||
agent.SessionID = UUID.Zero;
|
||||
agent.SecureSessionID = UUID.Zero;
|
||||
agent.circuitcode = 123;
|
||||
agent.BaseFolder = UUID.Zero;
|
||||
agent.InventoryFolder = UUID.Zero;
|
||||
agent.startpos = Vector3.Zero;
|
||||
agent.CapsPath = GetRandomCapsObjectPath();
|
||||
|
||||
acd1 = agent;
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void T013_TestRemoveNeighbourRegion()
|
||||
|
||||
Reference in New Issue
Block a user