Skip to content

Commit 40fc8fd

Browse files
authored
Merge branch 'develop-3.x.x' into fix/csharp14-contains-ambiguity-universalrpctests
2 parents 0623d92 + 44b7386 commit 40fc8fd

25 files changed

Lines changed: 352 additions & 103 deletions

‎.pr_agent.toml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,5 @@
44
# https://developer.portal.internal.unity.com/catalog/default/component/u-pr/docs/configuration/automatic_runs/
55

66
[github_app]
7-
handle_pr_actions = ['opened', 'ready_for_review'] # PR events that auto-run pr_commands
87
pr_commands = ["/harness-review"] # what runs on those events
98
reviewer_commands = ["/harness-review"] # what runs when @u-pr is added as reviewer

‎.yamato/cmb-service-standalone-tests.yml‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,7 @@ cmb_service_standalone_test_{{ project.name }}_{{ platform.name }}_{{ backend }}
6161
# run_cmb_service.sh builds and starts a release version of the full CMB service (along with the limited echo server)
6262
- ./Tools/CI/service.cmb/run_cmb_service.sh -e $ECHO_SERVER_PORT -s $CMB_SERVICE_PORT -l artifacts
6363

64-
- unity-downloader-cli --fast --wait -u {{ editor }} -c Editor {% if backend == "il2cpp" %} -c il2cpp {% endif %}{% if backend == "coreclr" %}{% unless coreclr_runtime_editors contains editor %} -c {{ platform.coreclr_component }} {% endunless %}{% endif %} --arch {{ platform.architecture }}
65-
- UnifiedTestRunner --suite=playmode --player-load-path=build/players --artifacts-path=test-results --testproject={{ project.path }} --editor-location=.Editor --playergraphicsapi=Null --fail-on-assert --rerun-strategy=Test --retry={{ num_test_retries }} --clean-library-on-rerun --timeout={{ test_timeout }}
64+
- UnifiedTestRunner --suite=playmode --platform={{ platform.standalone }} --scripting-backend={{ backend }} --player-load-path=build/players --artifacts-path=test-results --testproject={{ project.path }} --extra-player-arg=-batchmode --extra-player-arg=-nographics --fail-on-assert --rerun-strategy=Test --retry={{ num_test_retries }} --timeout={{ test_timeout }}
6665
artifacts:
6766
logs:
6867
paths:

‎.yamato/console-standalone-test.yml‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,17 @@ console_standalone_test_{{ project.name }}_{{ platform.name }}_{{ editor }}:
8888
model: {{ platform.model }} # This is set only in platforms where we want non-default model to use (more information in project.metafile)
8989
{% endif %}
9090
commands:
91-
- unity-downloader-cli --fast --wait -u {{ editor }} -c Editor -c il2cpp -c {{ platform.name }} --arch {{ platform.architecture }}
92-
- UnifiedTestRunner --suite=playmode --testproject={{ project.path }} --editor-location=.Editor --artifacts-path=test-results --player-load-path=build/players --fail-on-assert --rerun-strategy=Test --retry={{ num_test_retries }} --clean-library-on-rerun --timeout={{ test_timeout }}
91+
# Console players connect back to UTR's player connection listener on this VM, so the firewall must allow it
92+
- command: gsudo NetSh Advfirewall set allprofiles state off
93+
# Register the Bokken devkit with the platform's target tools so UTR can deploy and run the prebuilt player
94+
{% if platform.name == "ps5" %}
95+
- command: gsudo prospero-ctrl target add %BOKKEN_DEVICE_IP%
96+
{% elsif platform.name == "ps4" %}
97+
- command: orbis-ctrl add %BOKKEN_DEVICE_IP%
98+
{% else %}
99+
- command: '"%GameDK%/bin/xbconnect" /WS %BOKKEN_DEVICE_IP%'
100+
{% endif %}
101+
- UnifiedTestRunner --suite=playmode --platform={{ platform.standalone }} --scripting-backend=il2cpp --testproject={{ project.path }} --artifacts-path=test-results --player-load-path=build/players --player-connection-ip=%BOKKEN_HOST_IP% --fail-on-assert --rerun-strategy=Test --retry={{ num_test_retries }} --timeout={{ test_timeout }}
93102
variables:
94103
# PS4 related
95104
SCE_ORBIS_SDK_DIR: 'C:\Users\bokken\SCE\ps4_sdk_12_00'

‎.yamato/desktop-standalone-tests.yml‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ desktop_standalone_build_{{ project.name }}_{{ platform.name }}_{{ backend }}_{{
4949
{% endif %}
5050
commands:
5151
- unity-downloader-cli --fast --wait -u {{ editor }} -c Editor {% if backend == "il2cpp" %} -c il2cpp {% endif %}{% if backend == "coreclr" %}{% unless coreclr_runtime_editors contains editor %} -c {{ platform.coreclr_component }} {% endunless %}{% endif %} --arch {{ platform.architecture }}
52-
- UnifiedTestRunner --suite=playmode --platform={{ platform.standalone }} --editor-location=.Editor --testproject={{ project.path }} --scripting-backend={{ backend }} --testfilter="Unity.Netcode.RuntimeTests.*" --player-save-path=build/players --artifacts-path=artifacts --extra-editor-arg=-batchmode --extra-editor-arg=-nographics --reruncount=1 --clean-library-on-rerun --build-only --timeout={{ test_timeout }}
52+
- UnifiedTestRunner --suite=playmode --platform={{ platform.standalone }} --editor-location=.Editor --testproject={{ project.path }} --scripting-backend={{ backend }} --testfilter="Unity.Netcode.RuntimeTests.*;TestProject.RuntimeTests.*" --playergraphicsapi=Null --player-save-path=build/players --artifacts-path=artifacts --extra-editor-arg=-batchmode --extra-editor-arg=-nographics --reruncount=1 --clean-library-on-rerun --build-only --timeout={{ test_timeout }}
5353
artifacts:
5454
players:
5555
paths:
@@ -90,8 +90,7 @@ desktop_standalone_test_{{ project.name }}_{{ platform.name }}_{{ backend }}_{{
9090
{% endif %}
9191

9292
commands:
93-
- unity-downloader-cli --fast --wait -u {{ editor }} -c Editor {% if backend == "il2cpp" %} -c il2cpp {% endif %}{% if backend == "coreclr" %}{% unless coreclr_runtime_editors contains editor %} -c {{ platform.coreclr_component }} {% endunless %}{% endif %} --arch {{ platform.architecture }}
94-
- UnifiedTestRunner --suite=playmode --player-load-path=build/players --artifacts-path=test-results --testproject={{ project.path }} --editor-location=.Editor --playergraphicsapi=Null --fail-on-assert --rerun-strategy=Test --retry={{ num_test_retries }} --clean-library-on-rerun --timeout={{ test_timeout }}
93+
- UnifiedTestRunner --suite=playmode --platform={{ platform.standalone }} --scripting-backend={{ backend }} --player-load-path=build/players --artifacts-path=test-results --testproject={{ project.path }} --extra-player-arg=-batchmode --extra-player-arg=-nographics --fail-on-assert --rerun-strategy=Test --retry={{ num_test_retries }} --timeout={{ test_timeout }}
9594
artifacts:
9695
logs:
9796
paths:

‎.yamato/mobile-standalone-test.yml‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,6 @@ mobile_standalone_test_{{ project.name }}_{{ platform.name }}_{{ editor }}:
8282
model: {{ platform.model }} # This is set only in platforms where we want non-default model to use (more information in project.metafile)
8383
{% endif %}
8484
commands:
85-
# Installing editor. We still need the editor to run tests on standalone build and for that the Editor is required
86-
- unity-downloader-cli --fast --wait -u {{ editor }} -c Editor -c il2cpp {% if platform.base == "mac" %} -c ios {% else %} -c android {% endif %} --arch {{ platform.architecture }}
87-
8885
{% if platform.standalone == "Android" %}
8986
# Download standalone UnityTestRunner and ADB setup
9087
- command: wget http://artifactory-slo.bf.unity3d.com/artifactory/mobile-generic/android/ADBKeys.zip!/adbkey.pub -O %USERPROFILE%/.android/adbkey.pub
@@ -97,11 +94,11 @@ mobile_standalone_test_{{ project.name }}_{{ platform.name }}_{{ editor }}:
9794
# Run tests for Android devices
9895
- |
9996
set ANDROID_DEVICE_CONNECTION=%BOKKEN_DEVICE_IP%
100-
UnifiedTestRunner --suite=playmode --platform={{ platform.standalone }} --artifacts-path=test-results --player-load-path=build/players --testproject={{ project.path }} --editor-location=.Editor --player-connection-ip=%BOKKEN_HOST_IP% --fail-on-assert --rerun-strategy=Test --retry={{ num_test_retries }} --clean-library-on-rerun --timeout={{ test_timeout }}
97+
UnifiedTestRunner --suite=playmode --platform={{ platform.standalone }} --artifacts-path=test-results --player-load-path=build/players --testproject={{ project.path }} --player-connection-ip=%BOKKEN_HOST_IP% --fail-on-assert --rerun-strategy=Test --retry={{ num_test_retries }} --timeout={{ test_timeout }}
10198
{% else %}
10299

103100
# Run tests for non-Android devices
104-
- UnifiedTestRunner --suite=playmode --platform={{ platform.standalone }} --artifacts-path=test-results --player-load-path=build/players --testproject={{ project.path }} --editor-location=.Editor --fail-on-assert --rerun-strategy=Test --retry={{ num_test_retries }} --clean-library-on-rerun --timeout={{ test_timeout }} --device-id=%BOKKEN_DEVICE_ID%
101+
- UnifiedTestRunner --suite=playmode --platform={{ platform.standalone }} --artifacts-path=test-results --player-load-path=build/players --testproject={{ project.path }} --fail-on-assert --rerun-strategy=Test --retry={{ num_test_retries }} --timeout={{ test_timeout }} --device-id=%BOKKEN_DEVICE_ID%
105102
{% endif %}
106103
artifacts:
107104
logs:

‎.yamato/unified-tests.yml‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,24 @@ unified_test_{{ project.name }}_{{ platform.name }}_{{ editor }}:
3535

3636
commands:
3737
- unity-downloader-cli --fast --wait -u {{ editor }} -c Editor --arch {{ platform.architecture }}
38+
# Import and compile testproject in its own editor session first. The IL post-processor and compiler processes it starts
39+
# otherwise stay resident for the whole test pass and, on this agent, leave too little memory for the tests.
40+
- mkdir -p warmup
41+
# -releaseCodeOptimization pins the Release configuration the test runner compiles. An editor whose code optimization
42+
# preference is Debug would otherwise build the other configuration, and the test session would recompile everything.
43+
- .Editor/Unity -batchmode -nographics -releaseCodeOptimization -logFile warmup/editor.log -projectPath {{ project.path }} -quit
44+
# Stop any build processes that outlive the warm-up editor, then list what is left so the job log shows it.
45+
- dotnet build-server shutdown || true
46+
- pkill -f Unity.ILPP.Runner || true
47+
- pkill -f VBCSCompiler || true
48+
- pkill -f bee_backend || true
49+
- ps -eo rss,comm --sort=-rss | head -15
3850
- UnifiedTestRunner --testproject={{ project.path }} --suite=playmode --artifacts-path=test-results --editor-location=.Editor --rerun-strategy=Test --retry={{ num_test_retries }} --clean-library-on-rerun --timeout={{ test_timeout }}
3951
artifacts:
4052
logs:
4153
paths:
4254
- "test-results/**/*"
55+
- "warmup/**/*"
4356
dependencies:
4457
- .yamato/_run-all.yml#run_quick_checks
4558
{% endfor -%}

‎Tools/CI/service.cmb/run_cmb_service.sh‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,8 @@ cargo build --release --locked
171171
# The infinite loop is required as the service will exit each time all connected clients disconnect.
172172
# This means the service will exit after each test. The infinite loop will immediately restart the service each time it exits.
173173
logMessage "Running service integration tests..."
174-
echo "comb-server -l error --metrics-port 5000 standalone --port $service_port -t 60m --unity-version $unity_version"
174+
echo "comb-server -l warn -l ngo::session=info -l comb_server::session=info --metrics-port 5000 standalone --port $service_port -t 60m --unity-version $unity_version"
175175

176176
while :; do
177-
./target/release/comb-server -l error --metrics-port 5000 standalone --port $service_port -t 60m --unity-version $unity_version;
177+
./target/release/comb-server -l warn -l ngo::session=info -l comb_server::session=info --metrics-port 5000 standalone --port $service_port -t 60m --unity-version $unity_version;
178178
done & # <- use & to run the entire loop in the background

‎com.unity.netcode.gameobjects/CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Additional documentation and release notes are available at [Multiplayer Documen
2323

2424
### Fixed
2525

26+
- Issue where a client's clock kept alternating between running slightly fast and slightly slow on every frame, even after it had synchronized with the server. Interpolated objects juddered (a periodic motion artifact caused by mismatched frame rates): they moved in uneven steps instead of smoothly. Barely noticeable at the default `NetworkTimeSystem.AdjustmentRatio`, and clearly visible at higher values.
2627
- Issue where the IL post-processor could not resolve core library types, such as `Guid` and `List<T>`, in assemblies compiled against .NET reference assemblies, for example when targeting .NET 10. Those split the core library across `System.Runtime`, `System.Collections` and other assemblies.
2728
- Fixed issue where a prefab added to a `NetworkPrefabsList` while a session was running was registered more than once and logged a duplicate `GlobalObjectIdHash` error. (#4184)
2829
- Issue where moving a `NetworkObject` into another scene made the clients that did not observe it log "Trying to synchronize NetworkObjectId but it was not spawned". The scene migration is now only sent to the clients that observe the `NetworkObject`. (#4176)

‎com.unity.netcode.gameobjects/Runtime/Components/Helpers/UnifiedBootstrap.cs‎

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,17 @@ public override bool Initialize(string defaultWorldName)
7171
RegisterCreatedWorlds();
7272
Debug.Log($"Starting a world for {(networkManager.IsServer ? "Host" : "Client")}");
7373
s_WorldCounter++;
74-
LastCreatedWorld = networkManager.IsServer ? CreateSingleWorldHost($"HostSingleWorld-{s_WorldCounter}")
75-
: CreateClientWorld($"ClientWorld-{s_WorldCounter}");
74+
var world = CreateWorld(networkManager);
75+
LastCreatedWorld = world;
7676

77-
if (LastCreatedWorld == null)
77+
if (world == null)
7878
{
7979
s_WorldCounter--;
8080
Debug.LogError($"[{nameof(UnifiedBootstrap)}] World is null!");
8181
return false;
8282
}
8383

84-
if (!LastCreatedWorld.IsCreated)
84+
if (!world.IsCreated)
8585
{
8686
s_WorldCounter--;
8787
Debug.LogError($"[{nameof(UnifiedBootstrap)}] World was not created!");
@@ -90,10 +90,10 @@ public override bool Initialize(string defaultWorldName)
9090

9191
if (networkManager.LogLevel <= LogLevel.Developer)
9292
{
93-
NetworkLog.LogInfo($"[{nameof(UnifiedBootstrap)}] Created world: {LastCreatedWorld.Name} / {LastCreatedWorld.SequenceNumber}");
93+
NetworkLog.LogInfo($"[{nameof(UnifiedBootstrap)}] Created world: {world.Name} / {world.SequenceNumber}");
9494
}
9595

96-
networkManager.NetcodeWorld = (NetcodeWorld)LastCreatedWorld;
96+
networkManager.NetcodeWorld = (NetcodeWorld)world;
9797
s_CreatedWorlds.Add(networkManager.NetcodeWorld);
9898
}
9999
else
@@ -106,10 +106,33 @@ public override bool Initialize(string defaultWorldName)
106106
return true;
107107
}
108108

109-
~UnifiedBootstrap()
109+
/// <summary>
110+
/// Creates the world used by a <see cref="NetworkManager"/>'s hybrid session.
111+
/// </summary>
112+
/// <remarks>
113+
/// A server or host uses a single world host. A dedicated server build uses a server-only world instead, because
114+
/// Netcode for Entities cannot create a client world there. A build that only targets the client or the server
115+
/// cannot start a host.
116+
/// </remarks>
117+
private static World CreateWorld(NetworkManager networkManager)
110118
{
111-
LastCreatedWorld = null;
112-
Instance = null;
119+
#if UNITY_SERVER && !UNITY_EDITOR
120+
if (networkManager.IsClient)
121+
{
122+
Debug.LogError($"[{nameof(UnifiedBootstrap)}] A dedicated server build cannot start a {(networkManager.IsServer ? "host" : "client")} in hybrid mode.");
123+
return null;
124+
}
125+
return CreateServerWorld($"ServerWorld-{s_WorldCounter}");
126+
#elif UNITY_CLIENT && !UNITY_EDITOR
127+
if (networkManager.IsServer)
128+
{
129+
Debug.LogError($"[{nameof(UnifiedBootstrap)}] A client only build cannot start a {(networkManager.IsClient ? "host" : "server")} in hybrid mode. Set the Netcode for Entities client build target to ClientAndServer.");
130+
return null;
131+
}
132+
return CreateClientWorld($"ClientWorld-{s_WorldCounter}");
133+
#else
134+
return networkManager.IsServer ? CreateSingleWorldHost($"HostSingleWorld-{s_WorldCounter}") : CreateClientWorld($"ClientWorld-{s_WorldCounter}");
135+
#endif
113136
}
114137
}
115138
}

0 commit comments

Comments
 (0)