Skip to content

Commit 64c6768

Browse files
Merge develop-3.x.x into fix/clock-overshoot-and-unified-connections-scan
2 parents b46fac8 + e85a580 commit 64c6768

14 files changed

Lines changed: 111 additions & 45 deletions

File tree

‎.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:

‎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/Tests/Runtime/NetworkTransform/NetworkTransformOrderOfOperations.cs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ namespace Unity.Netcode.RuntimeTests
2424
[TestFixture(HostOrServer.DAHost)]
2525
[TestFixture(HostOrServer.Host)]
2626
[TestFixture(HostOrServer.Server)]
27+
[UnityPlatform(exclude = new[] { RuntimePlatform.PS4 })] // Ignored test tracked in MTT-16494
2728
internal class NetworkTransformOrderOfOperations : IntegrationTestWithApproximation
2829
{
2930
#region Configuration, Properties, and Overrides

‎com.unity.netcode.gameobjects/Tests/Runtime/NetworkVariable/NetworkVariableTests.cs‎

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1881,7 +1881,6 @@ public string ArrayStr<T>(NativeArray<T> arr) where T : unmanaged
18811881

18821882
[Test]
18831883
[UnityPlatform(exclude = new[] { RuntimePlatform.Android, RuntimePlatform.IPhonePlayer })] // Ignored test tracked in MTT-11343
1884-
[Repeat(5)]
18851884
public void WhenSerializingAndDeserializingVeryLargeValueTypeNativeArrayNetworkVariables_ValuesAreSerializedCorrectly(
18861885

18871886
[Values(typeof(byte), typeof(sbyte), typeof(short), typeof(ushort), typeof(int), typeof(uint),
@@ -1941,7 +1940,7 @@ public void WhenSerializingAndDeserializingVeryLargeValueTypeNativeArrayNetworkV
19411940
}
19421941
else if (testType == typeof(bool))
19431942
{
1944-
(var original, var original2, var changed, var changed2) = GetArarys(RandGenBytes<bool>);
1943+
(var original, var original2, var changed, var changed2) = GetArarys((rand) => rand.Next(2) == 1);
19451944
TestValueTypeNativeArray(original, changed);
19461945
TestValueTypeNativeArray(original2, changed2);
19471946
}
@@ -2343,7 +2342,6 @@ public string DictionaryStr<TKey, TVal>(Dictionary<TKey, TVal> list)
23432342

23442343
[Test]
23452344
[UnityPlatform(exclude = new[] { RuntimePlatform.Android, RuntimePlatform.IPhonePlayer })] // Ignored test tracked in MTT-11343
2346-
[Repeat(5)]
23472345
public void WhenSerializingAndDeserializingVeryLargeListNetworkVariables_ValuesAreSerializedCorrectly(
23482346

23492347
[Values(typeof(byte), typeof(sbyte), typeof(short), typeof(ushort), typeof(int), typeof(uint),
@@ -2538,7 +2536,6 @@ public void WhenSerializingAndDeserializingVeryLargeListNetworkVariables_ValuesA
25382536

25392537
[Test]
25402538
[UnityPlatform(exclude = new[] { RuntimePlatform.Android, RuntimePlatform.IPhonePlayer })] // Ignored test tracked in MTT-11343
2541-
[Repeat(5)]
25422539
public void WhenSerializingAndDeserializingVeryLargeHashSetNetworkVariables_ValuesAreSerializedCorrectly(
25432540

25442541
[Values(typeof(byte), typeof(sbyte), typeof(short), typeof(ushort), typeof(int), typeof(uint),
@@ -2701,8 +2698,7 @@ public void WhenSerializingAndDeserializingVeryLargeHashSetNetworkVariables_Valu
27012698
}
27022699

27032700
[Test]
2704-
[UnityPlatform(exclude = new[] { RuntimePlatform.Android, RuntimePlatform.IPhonePlayer })] // Ignored test tracked in MTT-11343
2705-
[Repeat(5)]
2701+
[UnityPlatform(exclude = new[] { RuntimePlatform.Android, RuntimePlatform.IPhonePlayer, RuntimePlatform.PS4, RuntimePlatform.PS5 })] // Ignored test tracked in MTT-11343, MTT-16494
27062702
public void WhenSerializingAndDeserializingVeryLargeDictionaryNetworkVariables_ValuesAreSerializedCorrectly(
27072703

27082704
[Values(typeof(byte), typeof(ulong), typeof(Vector2), typeof(HashMapKeyClass))] Type keyType,
@@ -3844,7 +3840,6 @@ public string NativeHashMapStr<TKey, TVal>(NativeHashMap<TKey, TVal> list)
38443840
}
38453841

38463842
[Test]
3847-
[Repeat(5)]
38483843
public void WhenSerializingAndDeserializingVeryLargeValueTypeNativeListNetworkVariables_ValuesAreSerializedCorrectly(
38493844

38503845
[Values(typeof(byte), typeof(sbyte), typeof(short), typeof(ushort), typeof(int), typeof(uint),
@@ -4035,11 +4030,10 @@ public void WhenSerializingAndDeserializingVeryLargeValueTypeNativeListNetworkVa
40354030
}
40364031

40374032
[Test]
4038-
[Repeat(5)]
40394033
public void WhenSerializingAndDeserializingVeryLargeValueTypeNativeHashSetNetworkVariables_ValuesAreSerializedCorrectly(
40404034

40414035
[Values(typeof(byte), typeof(sbyte), typeof(short), typeof(ushort), typeof(int), typeof(uint),
4042-
typeof(long), typeof(ulong), typeof(bool), typeof(char), typeof(float), typeof(double),
4036+
typeof(long), typeof(ulong), typeof(char), typeof(float), typeof(double),
40434037
typeof(Vector2), typeof(Vector3), typeof(Vector2Int), typeof(Vector3Int), typeof(Vector4),
40444038
typeof(Quaternion), typeof(Pose), typeof(HashableNetworkVariableTestStruct), typeof(FixedString32Bytes))]
40454039
Type testType)
@@ -4195,7 +4189,6 @@ public void WhenSerializingAndDeserializingVeryLargeValueTypeNativeHashSetNetwor
41954189
}
41964190

41974191
[Test]
4198-
[Repeat(5)]
41994192
public void WhenSerializingAndDeserializingVeryLargeValueTypeNativeHashMapNetworkVariables_ValuesAreSerializedCorrectly(
42004193

42014194
[Values(typeof(byte), typeof(ulong), typeof(Vector2), typeof(HashMapKeyStruct))] Type keyType,

‎com.unity.netcode.gameobjects/Tests/Runtime/NetworkVariable/NetworkVariableTraitsTests.cs‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public IEnumerator WhenNewValueIsLessThanThresholdButMaxTimeHasPassed_VariableIs
107107
var authorityComponent = GetAuthorityComponent();
108108
authorityComponent.TheVariable.CheckExceedsDirtinessThreshold = (in float value, in float newValue) => Mathf.Abs(newValue - value) >= 0.1;
109109
authorityComponent.TheVariable.SetUpdateTraits(new NetworkVariableUpdateTraits { MaxSecondsBetweenUpdates = 1.0f });
110-
authorityComponent.TheVariable.LastUpdateSent = authorityComponent.NetworkManager.NetworkTimeSystem.LocalTime;
110+
authorityComponent.TheVariable.UpdateLastSentTime();
111111

112112
var timeoutHelper = new TimeoutHelper(0.62f);
113113
var newValue = 0.05f;
@@ -127,7 +127,7 @@ public IEnumerator WhenNewValueIsGreaterThanThresholdButMinTimeHasNotPassed_Vari
127127
var authorityComponent = GetAuthorityComponent();
128128
authorityComponent.TheVariable.CheckExceedsDirtinessThreshold = (in float value, in float newValue) => Mathf.Abs(newValue - value) >= 0.1;
129129
authorityComponent.TheVariable.SetUpdateTraits(new NetworkVariableUpdateTraits { MinSecondsBetweenUpdates = 1 });
130-
authorityComponent.TheVariable.LastUpdateSent = authorityComponent.NetworkManager.NetworkTimeSystem.LocalTime;
130+
authorityComponent.TheVariable.UpdateLastSentTime();
131131

132132
var timeoutHelper = new TimeoutHelper(0.62f);
133133
var newValue = 0.15f;
@@ -146,7 +146,7 @@ public IEnumerator WhenNoThresholdIsSetButMinTimeHasNotPassed_VariableIsNotSeria
146146
{
147147
var authorityComponent = GetAuthorityComponent();
148148
authorityComponent.TheVariable.SetUpdateTraits(new NetworkVariableUpdateTraits { MinSecondsBetweenUpdates = 1 });
149-
authorityComponent.TheVariable.LastUpdateSent = authorityComponent.NetworkManager.NetworkTimeSystem.LocalTime;
149+
authorityComponent.TheVariable.UpdateLastSentTime();
150150

151151
var timeoutHelper = new TimeoutHelper(0.62f);
152152
var newValue = 0.15f;
@@ -170,7 +170,7 @@ public IEnumerator WhenNonTraitsIsDirtyButTraitsIsNotReadyToSend()
170170
{
171171
var authorityComponent = GetAuthorityComponent();
172172
authorityComponent.TheVariable.SetUpdateTraits(new NetworkVariableUpdateTraits { MinSecondsBetweenUpdates = 1 });
173-
authorityComponent.TheVariable.LastUpdateSent = authorityComponent.NetworkManager.NetworkTimeSystem.LocalTime;
173+
authorityComponent.TheVariable.UpdateLastSentTime();
174174

175175
var timeoutHelper = new TimeoutHelper(0.62f);
176176
var firstValue = 0.15f;

‎com.unity.netcode.gameobjects/Tests/Runtime/TestHelpers/Components/ObjectNameIdentifier.cs‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace Unity.Netcode.TestHelpers.Runtime
99
/// </summary>
1010
public class ObjectNameIdentifier : NetworkBehaviour
1111
{
12-
private ulong m_CurrentOwner;
12+
private ulong m_RegisteredLocalClientId;
1313
private ulong m_CurrentNetworkObjectId;
1414
private bool m_IsRegistered;
1515

@@ -45,18 +45,18 @@ protected void RegisterAndLabelNetworkObject()
4545
// This is required otherwise it will try to continue to update the NetworkBehaviour even if
4646
// it has been destroyed.
4747
m_NetworkObject = NetworkObject;
48-
m_CurrentOwner = OwnerClientId;
48+
m_RegisteredLocalClientId = NetworkManager.LocalClientId;
4949
m_CurrentNetworkObjectId = NetworkObjectId;
5050

5151
var serverOrClient = IsServer ? "Server" : "Client";
5252
if (NetworkObject.IsPlayerObject)
5353
{
54-
gameObject.name = NetworkManager.LocalClientId == OwnerClientId ? $"{m_OriginalName}-{k_TagInfoStart}{OwnerClientId}{k_TagInfoStop}-Local{m_OriginalName}" :
55-
$"{m_OriginalName}-{k_TagInfoStart}{OwnerClientId}{k_TagInfoStop}- On{serverOrClient}{k_TagInfoStart}{NetworkManager.LocalClientId}{k_TagInfoStop}";
54+
gameObject.name = m_RegisteredLocalClientId == OwnerClientId ? $"{m_OriginalName}-{k_TagInfoStart}{OwnerClientId}{k_TagInfoStop}-Local{m_OriginalName}" :
55+
$"{m_OriginalName}-{k_TagInfoStart}{OwnerClientId}{k_TagInfoStop}- On{serverOrClient}{k_TagInfoStart}{m_RegisteredLocalClientId}{k_TagInfoStop}";
5656
}
5757
else
5858
{
59-
gameObject.name = $"{m_OriginalName}{k_TagInfoStart}{NetworkObjectId}{k_TagInfoStop}-On{serverOrClient}{k_TagInfoStart}{NetworkManager.LocalClientId}{k_TagInfoStop}";
59+
gameObject.name = $"{m_OriginalName}{k_TagInfoStart}{NetworkObjectId}{k_TagInfoStop}-On{serverOrClient}{k_TagInfoStart}{m_RegisteredLocalClientId}{k_TagInfoStop}";
6060
}
6161

6262
// Don't add the player objects to the global list of NetworkObjects
@@ -75,7 +75,7 @@ protected void DeRegisterNetworkObject()
7575
{
7676
if (m_IsRegistered)
7777
{
78-
NetcodeIntegrationTest.DeregisterNetworkObject(m_CurrentOwner, m_CurrentNetworkObjectId);
78+
NetcodeIntegrationTest.DeregisterNetworkObject(m_RegisteredLocalClientId, m_CurrentNetworkObjectId);
7979
m_IsRegistered = false;
8080
}
8181
}

0 commit comments

Comments
 (0)