Skip to content

Commit 11922a0

Browse files
zain-mecklaiShadauxCatashwinimurt
authored
fix: ILPP filter out tests (#2024)
* update timeout * remote UNET * fix: Stop populating ILPPMessageProvider with messages from outside the main runtime assembly * reset the changes to the scene * Initialiize the Rawgithash variable for the local execution case * Add a little more logging and see if we can find why allactons hasn't been populated at the time the test runs * Update the test to reduce the number of log messages as well as make the messages more informative * Lot when initlializatioon is complete * More logging clean up and adding information about registered test methods * Move init all steps to Awake instead of Start, eventually need to figure out how to block initial connection until init all steps is done * Move init to Awake * Fix missing log message in TestCoordinator Start method * Use GPU for Ubuntu image * Remove the nographics requirement and see if we can stabilize 2022.2 * Use -nographics and don't request a GPU for Linux * try to use ubuntu-20 and see if this is more stable * Use GPU for Linux and use Ubuntu 18 * Remove nographics again as it clearly makes an improvement * Adding a GPU and removing nographics just made things slower but still failing so no point making this change, reverse it Co-authored-by: Kitty Draper <[email protected]> Co-authored-by: ashwini <[email protected]>
1 parent 105bbe2 commit 11922a0

File tree

7 files changed

+26
-17
lines changed

7 files changed

+26
-17
lines changed

.yamato/multiprocess-project-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ singlenode_multiprocess_test_testproject_{{ editor }}_{{ platform.name }}:
1616
{% if editor != "trunk" %}
1717
- unity-downloader-cli -u {{ editor }} -c editor -w --fast
1818
- curl -s https://artifactory.prd.it.unity3d.com/artifactory/unity-tools-local/utr-standalone/utr{% if platform.name == "win" %}.bat --output utr.bat{% endif %}{% if platform.name != "win" %} --output utr && chmod +x ./utr{% endif %}
19-
- {{ platform.editorpath }} -projectpath testproject -batchmode -nographics -quit -logfile BuildMultiprocessTestPlayer.log -executeMethod Unity.Netcode.MultiprocessRuntimeTests.BuildMultiprocessTestPlayer.BuildRelease
19+
- {{ platform.editorpath }} -projectpath testproject -batchmode -quit -nographics -logfile BuildMultiprocessTestPlayer.log -executeMethod Unity.Netcode.MultiprocessRuntimeTests.BuildMultiprocessTestPlayer.BuildRelease
2020
{% if platform.name == "mac" %} - sudo codesign --force --deep --sign - ./testproject/Builds/MultiprocessTests/MultiprocessTestPlayer.app{% endif %}
2121
- {{ platform.utr }} --suite=playmode --testproject=testproject --editor-location=.Editor --testfilter=Unity.Netcode.MultiprocessRuntimeTests --extra-editor-arg=-bypassIgnoreUTR
2222
{% endif %}

.yamato/project.metafile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,4 @@ scripting_backends:
7272
- il2cpp
7373

7474
# Images with build-tools installed required for Standalone Tests - IL2CPP
75-
win_il2cpp_test_image: dots-player/windows10:latest
75+
win_il2cpp_test_image: dots-player/windows10:latest

com.unity.netcode.gameobjects/Editor/CodeGen/INetworkMessageILPP.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ internal sealed class INetworkMessageILPP : ILPPInterface
1818
public override ILPPInterface GetInstance() => this;
1919

2020
public override bool WillProcess(ICompiledAssembly compiledAssembly) =>
21-
compiledAssembly.Name == CodeGenHelpers.RuntimeAssemblyName ||
22-
compiledAssembly.References.Any(filePath => Path.GetFileNameWithoutExtension(filePath) == CodeGenHelpers.RuntimeAssemblyName);
21+
compiledAssembly.Name == CodeGenHelpers.RuntimeAssemblyName;
2322

2423
private readonly List<DiagnosticMessage> m_Diagnostics = new List<DiagnosticMessage>();
2524

testproject/Assets/Tests/Runtime/MultiprocessRuntime/BaseMultiprocessTests.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,13 @@ public virtual void SetupTestSuite()
8585

8686
private void OnSceneLoaded(Scene scene, LoadSceneMode mode)
8787
{
88-
MultiprocessLogger.Log($"OnSceneLoaded {scene.name}");
8988
SceneManager.sceneLoaded -= OnSceneLoaded;
9089
if (scene.name == BuildMultiprocessTestPlayer.MainSceneName)
9190
{
9291
SceneManager.SetActiveScene(scene);
9392
}
9493

9594
var transport = NetworkManager.Singleton.NetworkConfig.NetworkTransport;
96-
MultiprocessLogger.Log($"transport is {transport}");
9795
switch (transport)
9896
{
9997
#if UNITY_UNET_PRESENT

testproject/Assets/Tests/Runtime/MultiprocessRuntime/ExecuteStepInContext.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
using UnityEngine;
1111
using UnityEngine.TestTools;
1212
using Debug = UnityEngine.Debug;
13+
using Unity.Netcode.MultiprocessRuntimeTests;
1314

1415
/// <summary>
1516
/// Allows for context based delegate execution.
@@ -83,6 +84,7 @@ private static string GetMethodIdentifier(MethodBase callerMethod)
8384

8485
internal static void InitializeAllSteps()
8586
{
87+
MultiprocessLogger.Log("InitializeAllSteps - Start");
8688
// registering magically all context based steps
8789
IsRegistering = true;
8890
var registeredMethods = typeof(TestCoordinator).Assembly.GetTypes().SelectMany(t => t.GetMethods())
@@ -147,6 +149,7 @@ object[] GetParameterValuesToPassFunc(ParameterInfo[] parameterInfo)
147149

148150
IsRegistering = false;
149151
HasRegistered = true;
152+
MultiprocessLogger.Log("InitializeAllSteps - Done");
150153
}
151154

152155
/// <summary>
@@ -196,9 +199,11 @@ public ExecuteStepInContext(StepExecutionContext actionContext, Action<byte[]> s
196199
{
197200
Assert.That(AllActions, Does.Not.Contain(currentActionId)); // sanity check
198201
AllActions[currentActionId] = this;
202+
MultiprocessLogger.Log($"InitializeAllSteps - Registering {currentActionId}");
199203
}
200204
else
201205
{
206+
MultiprocessLogger.Log($"InitializeAllSteps - Not Registering {currentActionId}");
202207
if (shouldExecuteLocally)
203208
{
204209
m_StepToExecute.Invoke(paramToPass);

testproject/Assets/Tests/Runtime/MultiprocessRuntime/Helpers/MultiprocessOrchestration.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ public static int ActiveWorkerCount()
8484

8585
if (s_Processes.Count > 0)
8686
{
87-
MultiprocessLogger.Log($"s_Processes.Count is {s_Processes.Count}");
8887
foreach (var p in s_Processes)
8988
{
9089
if ((p != null) && (!p.HasExited))

testproject/Assets/Tests/Runtime/MultiprocessRuntime/TestCoordinator.cs

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public class TestCoordinator : NetworkBehaviour
2727
{
2828
public const int PerTestTimeoutSec = 5 * 60; // seconds
2929

30-
public const float MaxWaitTimeoutSec = 20;
30+
public const float MaxWaitTimeoutSec = 60;
3131
private const char k_MethodFullNameSplitChar = '@';
3232

3333
private bool m_ShouldShutdown;
@@ -75,8 +75,10 @@ public void Awake()
7575
enabled = false;
7676
NetworkManager.OnClientConnectedCallback += OnClientConnectedCallback;
7777

78+
MultiprocessLogger.Log("Awake - Initialize All Steps");
79+
ExecuteStepInContext.InitializeAllSteps();
80+
7881
s_ProcessId = Process.GetCurrentProcess().Id;
79-
MultiprocessLogger.Log($"Awake {s_ProcessId}");
8082
ReadGitHashFile();
8183

8284
// Configuration via command line (supported for many but not all platforms)
@@ -165,6 +167,7 @@ private async void ConfigureViaWebApi()
165167

166168
private void ReadGitHashFile()
167169
{
170+
Rawgithash = "uninitialized";
168171
try
169172
{
170173
var githash_resource = Resources.Load<TextAsset>("Text/githash");
@@ -216,12 +219,7 @@ private void SetAddressAndPort()
216219

217220
public void Start()
218221
{
219-
MultiprocessLogger.Log("Start");
220-
MultiprocessLogger.Log("Initialize All Steps");
221-
ExecuteStepInContext.InitializeAllSteps();
222-
MultiprocessLogger.Log($"Initialize All Steps... done");
223-
MultiprocessLogger.Log($"IsInvoking: {NetworkManager.Singleton.IsInvoking()}");
224-
MultiprocessLogger.Log($"IsActiveAndEnabled: {NetworkManager.Singleton.isActiveAndEnabled}");
222+
MultiprocessLogger.Log($"TestCoordinator - Start");
225223
}
226224

227225
public void Update()
@@ -282,8 +280,11 @@ public void OnDisable()
282280
// Once we are connected, we can run the update method
283281
public void OnClientConnectedCallback(ulong clientId)
284282
{
285-
MultiprocessLogger.Log("Client start callback, enabling behavior");
286-
enabled = true;
283+
if (enabled == false)
284+
{
285+
MultiprocessLogger.Log($"OnClientConnectedCallback enabling behavior clientId: {clientId} {NetworkManager.Singleton.IsHost}/{NetworkManager.Singleton.IsClient} IsRegistering:{ExecuteStepInContext.IsRegistering}");
286+
enabled = true;
287+
}
287288
}
288289

289290
private static void OnClientDisconnectCallback(ulong clientId)
@@ -424,6 +425,7 @@ public void InvokeFromMethodActionRpc(Action methodInfo)
424425
public void TriggerActionIdClientRpc(string actionId, byte[] args, bool ignoreException, ClientRpcParams clientRpcParams = default)
425426
{
426427
MultiprocessLogger.Log($"received RPC from server, client side triggering action ID {actionId}");
428+
WriteLogServerRpc($"received RPC from server, client side triggering action ID {actionId} {ExecuteStepInContext.AllActions.Count}");
427429
try
428430
{
429431
ExecuteStepInContext.AllActions[actionId].Invoke(args);
@@ -519,5 +521,11 @@ public void WriteErrorServerRpc(string errorMessage, ServerRpcParams receivePara
519521
{
520522
MultiprocessLogger.LogError($"[Netcode-Server Sender={receiveParams.Receive.SenderClientId}] {errorMessage}");
521523
}
524+
525+
[ServerRpc(RequireOwnership = false)]
526+
public void WriteLogServerRpc(string logMessage, ServerRpcParams receiveParams = default)
527+
{
528+
MultiprocessLogger.Log($"[Netcode-Server Sender={receiveParams.Receive.SenderClientId}] {logMessage}");
529+
}
522530
}
523531

0 commit comments

Comments
 (0)