Skip to content

Commit 22728b7

Browse files
test - fix
Validating clients had initialized was some how was encapsulated within a verbose debug check. Not sure why this was passing before other than certain messages might have always been processed out of order before...?
1 parent 7ccaa51 commit 22728b7

File tree

1 file changed

+20
-23
lines changed

1 file changed

+20
-23
lines changed

com.unity.netcode.gameobjects/Tests/Runtime/NetworkVariable/NetworkVariableCollectionsTests.cs

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -782,37 +782,34 @@ public IEnumerator TestDictionaryCollections()
782782

783783
m_CurrentKey = 1000;
784784

785-
if (m_EnableDebug)
785+
VerboseDebug(">>>>>>>>>>>>>>>>>>>>>>>>>>>>> Init Values <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");
786+
foreach (var client in m_Clients)
786787
{
787-
VerboseDebug(">>>>>>>>>>>>>>>>>>>>>>>>>>>>> Init Values <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");
788+
compDictionary = client.LocalClient.PlayerObject.GetComponent<DictionaryTestHelper>();
789+
compDictionary.InitValues();
790+
compDictionaryServer = m_PlayerNetworkObjects[NetworkManager.ServerClientId][client.LocalClientId].GetComponent<DictionaryTestHelper>();
791+
compDictionaryServer.InitValues();
792+
}
793+
VerboseDebug(">>>>>>>>>>>>>>>>>>>>>>>>>>>>> Init Check <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");
794+
var count = 0;
795+
while (count < 3)
796+
{
797+
m_InitializedStatus.Clear();
788798
foreach (var client in m_Clients)
789799
{
790-
compDictionary = client.LocalClient.PlayerObject.GetComponent<DictionaryTestHelper>();
791-
compDictionary.InitValues();
792-
compDictionaryServer = m_PlayerNetworkObjects[NetworkManager.ServerClientId][client.LocalClientId].GetComponent<DictionaryTestHelper>();
793-
compDictionaryServer.InitValues();
800+
yield return ValidateClients(client, true);
794801
}
795-
VerboseDebug(">>>>>>>>>>>>>>>>>>>>>>>>>>>>> Init Check <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");
796-
var count = 0;
797-
while (count < 3)
802+
if (m_IsInitialized)
798803
{
799-
m_InitializedStatus.Clear();
800-
foreach (var client in m_Clients)
801-
{
802-
yield return ValidateClients(client, true);
803-
}
804-
if (m_IsInitialized)
805-
{
806-
break;
807-
}
808-
count++;
809-
m_Stage = 0;
804+
break;
810805
}
811-
812-
Assert.IsTrue(m_IsInitialized, $"Not all clients synchronized properly!\n {m_InitializedStatus.ToString()}");
813-
VerboseDebug(m_InitializedStatus.ToString());
806+
count++;
807+
m_Stage = 0;
814808
}
815809

810+
Assert.IsTrue(m_IsInitialized, $"Not all clients synchronized properly!\n {m_InitializedStatus.ToString()}");
811+
VerboseDebug(m_InitializedStatus.ToString());
812+
816813
VerboseDebug(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> BEGIN <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");
817814
foreach (var client in m_Clients)
818815
{

0 commit comments

Comments
 (0)