Skip to content

Commit 9ec7b43

Browse files
committed
unbreak test
1 parent 8c5745d commit 9ec7b43

File tree

1 file changed

+4
-16
lines changed

1 file changed

+4
-16
lines changed

com.unity.netcode.gameobjects/Tests/Runtime/DistributedAuthority/DistributedAuthorityConnectionTest.cs

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,10 @@ internal class DistributedAuthorityConnectionTest : NetcodeIntegrationTest
1414
{
1515
protected override int NumberOfClients => 1;
1616

17-
private NetworkManager SessionOwner => m_ClientNetworkManagers[0];
18-
19-
// Use the CMB Service for all tests
20-
protected override bool UseCMBService() => true;
21-
2217
// Set the network topology to distributed authority for all tests
2318
protected override NetworkTopologyTypes OnGetNetworkTopologyType() => NetworkTopologyTypes.DistributedAuthority;
2419

25-
26-
public DistributedAuthorityConnectionTest() : base(NetworkTopologyTypes.DistributedAuthority, HostOrServer.DAHost) { }
27-
20+
public DistributedAuthorityConnectionTest() : base(HostOrServer.DAHost) { }
2821

2922
private GameObject m_SpawnObject;
3023

@@ -36,7 +29,6 @@ protected override void OnServerAndClientsCreated()
3629
foreach (var client in m_ClientNetworkManagers)
3730
{
3831
client.NetworkConfig.EnableSceneManagement = false;
39-
client.NetworkConfig.AutoSpawnPlayerPrefabClientSide = true;
4032

4133
// Validate we are in distributed authority mode with client side spawning and using CMB Service
4234
Assert.True(client.NetworkConfig.NetworkTopology == NetworkTopologyTypes.DistributedAuthority, "Distributed authority topology is not set!");
@@ -47,11 +39,10 @@ protected override void OnServerAndClientsCreated()
4739
// Create a prefab for creating and destroying tests (auto-registers with NetworkManagers)
4840
m_SpawnObject = CreateNetworkObjectPrefab("TestObject");
4941
}
50-
5142
[UnityTest]
5243
public IEnumerator CreateObjectNew()
5344
{
54-
SpawnObject(m_SpawnObject, SessionOwner);
45+
SpawnObject(m_SpawnObject, m_ClientNetworkManagers[0]);
5546

5647
yield return WaitForConditionOrTimeOut(CheckObjectExists);
5748
AssertOnTimeout("failed to spawn object!");
@@ -80,8 +71,8 @@ private static string GetAddressToBind()
8071
return Dns.GetHostAddresses(value).First().ToString();
8172
}
8273

83-
[UnityTest]
84-
public IEnumerator CanConnectToServer()
74+
[Test]
75+
public void CanConnectToServer()
8576
{
8677
var address = Dns.GetHostAddresses(k_TransportHost).First();
8778
var endpoint = NetworkEndpoint.Parse(address.ToString(), k_TransportPort);
@@ -103,9 +94,6 @@ public IEnumerator CanConnectToServer()
10394
}
10495

10596
driver.Disconnect(connection);
106-
107-
// Ensure the rust server fully times out and disconnects
108-
yield return new WaitForSeconds(2f);
10997
}
11098

11199

0 commit comments

Comments
 (0)