Skip to content

Commit fd80f71

Browse files
committed
Fix for CI issues (will file a ticket)
1 parent e60b922 commit fd80f71

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

com.unity.netcode.gameobjects/Tests/Editor/Build/BuildTests.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@ public void BasicBuildTest()
2525

2626
if (buildTargetSupported)
2727
{
28+
#if UNIFIED_NETCODE
29+
// Netcode for Entities' build preprocessor writes an asset under this folder and errors if the parent does not already exist.
30+
if (!AssetDatabase.IsValidFolder("Assets/netcode-build-assets-temp"))
31+
{
32+
AssetDatabase.CreateFolder("Assets", "netcode-build-assets-temp");
33+
AssetDatabase.Refresh();
34+
}
35+
#endif
2836
var buildReport = BuildPipeline.BuildPlayer(
2937
new[] { Path.Combine(packagePath, DefaultBuildScenePath) },
3038
Path.Combine(Path.GetDirectoryName(Application.dataPath), "Builds", nameof(BuildTests)),

com.unity.netcode.gameobjects/Tests/Runtime/TestHelpers/NetcodeIntegrationTest.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -708,6 +708,10 @@ public void OneTimeSetup()
708708
InternalOnOneTimeSetup();
709709
}
710710

711+
#if UNIFIED_NETCODE && UNITY_EDITOR
712+
private bool m_PreviousWarnBatchedTicks;
713+
#endif
714+
711715
private void InternalOnOneTimeSetup()
712716
{
713717
Application.runInBackground = true;
@@ -723,6 +727,12 @@ private void InternalOnOneTimeSetup()
723727
// Enable NetcodeIntegrationTest auto-label feature
724728
NetcodeIntegrationTestHelpers.RegisterNetcodeIntegrationTest(true);
725729

730+
#if UNIFIED_NETCODE && UNITY_EDITOR
731+
// Netcode for Entities emits a performance-dependent "Server Tick Batching" warning on loaded CI agents that would fail strict log assertions.
732+
m_PreviousWarnBatchedTicks = MultiplayerPlayModePreferences.WarnBatchedTicks;
733+
MultiplayerPlayModePreferences.WarnBatchedTicks = false;
734+
#endif
735+
726736
#if UNITY_INCLUDE_TESTS
727737
// Provide an external hook to be able to make adjustments to netcode classes prior to running any tests
728738
NetworkManager.OnOneTimeSetup();
@@ -1905,6 +1915,10 @@ public void OneTimeTearDown()
19051915
// Disable NetcodeIntegrationTest auto-label feature
19061916
NetcodeIntegrationTestHelpers.RegisterNetcodeIntegrationTest(false);
19071917

1918+
#if UNIFIED_NETCODE && UNITY_EDITOR
1919+
MultiplayerPlayModePreferences.WarnBatchedTicks = m_PreviousWarnBatchedTicks;
1920+
#endif
1921+
19081922
UnloadRemainingScenes();
19091923

19101924
VerboseDebug($"Exiting {nameof(OneTimeTearDown)}");

0 commit comments

Comments
 (0)