From d5d0dc7df9fd9a4caa06a8ad265e80f272809984 Mon Sep 17 00:00:00 2001 From: michalChrobot Date: Tue, 15 Apr 2025 10:35:47 +0200 Subject: [PATCH 1/4] WhenManyObjectsAreSpawnedAtOnce_AllAreReceived updated to its newer version from NGOv2.X branch --- .../NetworkObjectSpawnManyObjectsTests.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/com.unity.netcode.gameobjects/Tests/Runtime/NetworkObject/NetworkObjectSpawnManyObjectsTests.cs b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkObject/NetworkObjectSpawnManyObjectsTests.cs index 4ed1f816fc..d4cb3cb73a 100644 --- a/com.unity.netcode.gameobjects/Tests/Runtime/NetworkObject/NetworkObjectSpawnManyObjectsTests.cs +++ b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkObject/NetworkObjectSpawnManyObjectsTests.cs @@ -47,19 +47,23 @@ protected override void OnServerAndClientsCreated() } [UnityTest] - // When this test fails it does so without an exception and will wait the default ~6 minutes - [Timeout(360000)] // Tracked in MTT-11360 public IEnumerator WhenManyObjectsAreSpawnedAtOnce_AllAreReceived() { + var timeStarted = Time.realtimeSinceStartup; for (int x = 0; x < k_SpawnedObjects; x++) { NetworkObject serverObject = Object.Instantiate(m_PrefabToSpawn.Prefab).GetComponent(); serverObject.NetworkManagerOwner = m_ServerNetworkManager; serverObject.Spawn(); } + + var timeSpawned = Time.realtimeSinceStartup - timeStarted; + // Provide plenty of time to spawn all 1500 objects in case the CI VM is running slow + var timeoutHelper = new TimeoutHelper(30); // ensure all objects are replicated - yield return WaitForConditionOrTimeOut(() => SpawnObjecTrackingComponent.SpawnedObjects == k_SpawnedObjects); - AssertOnTimeout($"Timed out waiting for the client to spawn {k_SpawnedObjects} objects!"); + yield return WaitForConditionOrTimeOut(() => SpawnObjecTrackingComponent.SpawnedObjects == k_SpawnedObjects, timeoutHelper); + + AssertOnTimeout($"Timed out waiting for the client to spawn {k_SpawnedObjects} objects! Time to spawn: {timeSpawned} | Time to timeout: {timeStarted - Time.realtimeSinceStartup}", timeoutHelper); } } } From d1206544ed96a905384bd4893b78d406f3c57ca9 Mon Sep 17 00:00:00 2001 From: michalChrobot Date: Tue, 15 Apr 2025 10:38:53 +0200 Subject: [PATCH 2/4] Modified package-tests to execute only 1 test --- .yamato/package-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.yamato/package-tests.yml b/.yamato/package-tests.yml index 0d354967ae..528a86a201 100644 --- a/.yamato/package-tests.yml +++ b/.yamato/package-tests.yml @@ -47,7 +47,7 @@ package_test_-_ngo_{{ editor }}_{{ platform.name }}: # Run UTR to test packages. - upm-pvp create-test-project test-project --packages "upm-ci~/packages/*.tgz" --filter "com.unity.netcode.gameobjects" --unity .Editor - - UnifiedTestRunner --suite=editor --suite=playmode --editor-location=.Editor --testproject=test-project --artifacts-path=test-results "--ff={ops.upmpvpevidence.enable=true}" --extra-editor-arg=-batchmode --extra-editor-arg=-nographics --reruncount=1 --clean-library-on-rerun + - UnifiedTestRunner --suite=editor --suite=playmode --editor-location=.Editor --testproject=test-project --artifacts-path=test-results "--ff={ops.upmpvpevidence.enable=true}" --extra-editor-arg=-batchmode --extra-editor-arg=-nographics --reruncount=1 --testfilter=WhenManyObjectsAreSpawnedAtOnce_AllAreReceived --clean-library-on-rerun artifacts: logs: paths: From 6d2a40e0348261c813311bf1c808137dd5991862 Mon Sep 17 00:00:00 2001 From: michalChrobot Date: Tue, 15 Apr 2025 11:09:02 +0200 Subject: [PATCH 3/4] Revert "Modified package-tests to execute only 1 test" This reverts commit d1206544ed96a905384bd4893b78d406f3c57ca9. --- .yamato/package-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.yamato/package-tests.yml b/.yamato/package-tests.yml index 528a86a201..0d354967ae 100644 --- a/.yamato/package-tests.yml +++ b/.yamato/package-tests.yml @@ -47,7 +47,7 @@ package_test_-_ngo_{{ editor }}_{{ platform.name }}: # Run UTR to test packages. - upm-pvp create-test-project test-project --packages "upm-ci~/packages/*.tgz" --filter "com.unity.netcode.gameobjects" --unity .Editor - - UnifiedTestRunner --suite=editor --suite=playmode --editor-location=.Editor --testproject=test-project --artifacts-path=test-results "--ff={ops.upmpvpevidence.enable=true}" --extra-editor-arg=-batchmode --extra-editor-arg=-nographics --reruncount=1 --testfilter=WhenManyObjectsAreSpawnedAtOnce_AllAreReceived --clean-library-on-rerun + - UnifiedTestRunner --suite=editor --suite=playmode --editor-location=.Editor --testproject=test-project --artifacts-path=test-results "--ff={ops.upmpvpevidence.enable=true}" --extra-editor-arg=-batchmode --extra-editor-arg=-nographics --reruncount=1 --clean-library-on-rerun artifacts: logs: paths: From da8c426e6dbffc791e86b4f98e0779500f351987 Mon Sep 17 00:00:00 2001 From: michalChrobot Date: Tue, 15 Apr 2025 11:15:39 +0200 Subject: [PATCH 4/4] Removed unused directive --- .../Runtime/NetworkObject/NetworkObjectSpawnManyObjectsTests.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/com.unity.netcode.gameobjects/Tests/Runtime/NetworkObject/NetworkObjectSpawnManyObjectsTests.cs b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkObject/NetworkObjectSpawnManyObjectsTests.cs index d4cb3cb73a..efa4a48ef4 100644 --- a/com.unity.netcode.gameobjects/Tests/Runtime/NetworkObject/NetworkObjectSpawnManyObjectsTests.cs +++ b/com.unity.netcode.gameobjects/Tests/Runtime/NetworkObject/NetworkObjectSpawnManyObjectsTests.cs @@ -1,5 +1,4 @@ using System.Collections; -using NUnit.Framework; using Unity.Netcode.TestHelpers.Runtime; using UnityEngine; using UnityEngine.TestTools;