From 5e4b72db77391e13028831cf58a02d340cae9529 Mon Sep 17 00:00:00 2001 From: Damon Barry Date: Wed, 22 Jul 2026 10:47:57 -0700 Subject: [PATCH 1/3] Consolidate Azure CLI credential instances in test helper --- .../IotHub.cs | 33 ++++++++++++++----- .../OsPlatform.cs | 2 ++ 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/test/Microsoft.Azure.Devices.Edge.Test.Common/IotHub.cs b/test/Microsoft.Azure.Devices.Edge.Test.Common/IotHub.cs index ec01cd88c1a..acdb331b756 100644 --- a/test/Microsoft.Azure.Devices.Edge.Test.Common/IotHub.cs +++ b/test/Microsoft.Azure.Devices.Edge.Test.Common/IotHub.cs @@ -19,6 +19,7 @@ namespace Microsoft.Azure.Devices.Edge.Test.Common public class IotHub { + readonly AzureCliCredential credential; readonly string eventHubName; readonly string eventHubNamespace; readonly Lazy> eventHubPartitionCount; @@ -27,8 +28,22 @@ public class IotHub readonly Lazy serviceClient; static readonly TimeSpan eventHubRequestDuration = TimeSpan.FromSeconds(20); + static AzureCliCredential CreateAzureCliCredential() + { + if (OsPlatform.IsArm() && OsPlatform.Is32Bit()) + { + return new AzureCliCredential(new AzureCliCredentialOptions + { + ProcessTimeout = TimeSpan.FromSeconds(60) + }); + } + + return new AzureCliCredential(); + } + public IotHub(string iotHubHostname, string eventHubName, string eventHubNamespace, Option proxyUri) { + this.credential = IotHub.CreateAzureCliCredential(); this.eventHubName = eventHubName; this.eventHubNamespace = eventHubNamespace; this.iotHubHostname = iotHubHostname; @@ -41,7 +56,7 @@ public IotHub(string iotHubHostname, string eventHubName, string eventHubNamespa proxy.ForEach(p => settings.Proxy = p); return RegistryManager.Create( this.iotHubHostname, - new AzureCliCredential(), + this.credential, settings); }); @@ -52,7 +67,7 @@ public IotHub(string iotHubHostname, string eventHubName, string eventHubNamespa proxy.ForEach(p => settings.HttpProxy = p); return ServiceClient.Create( this.iotHubHostname, - new AzureCliCredential(), + this.credential, DeviceTransportType.Amqp_WebSocket_Only, settings); }); @@ -72,11 +87,11 @@ public IotHub(string iotHubHostname, string eventHubName, string eventHubNamespa async Task GetEventHubPartitionCountAsync() { await using var consumer = new EventHubConsumerClient( - EventHubConsumerClient.DefaultConsumerGroupName, - this.eventHubNamespace, - this.eventHubName, - new AzureCliCredential(), - consumerOptions); + EventHubConsumerClient.DefaultConsumerGroupName, + this.eventHubNamespace, + this.eventHubName, + this.credential, + consumerOptions); string[] partitionIds = await consumer.GetPartitionIdsAsync(); return partitionIds.Length; @@ -108,7 +123,7 @@ public async Task CreateDeviceIdentityAsync(Device device, CancellationT // identity and recreate so the repro run isn't blocked by leftover state. Log.Warning($"Device identity '{device.Id}' already exists; deleting orphaned identity and recreating."); await this.RegistryManager.RemoveDeviceAsync(device.Id, token); - return await this.RegistryManager.AddDeviceAsync(device, token); + return await this.RegistryManager.AddDeviceAsync(device, token); } } @@ -240,7 +255,7 @@ public async Task ReceiveEventsAsync( EventPosition.FromEnqueuedTime(seekTime), this.eventHubNamespace, this.eventHubName, - new AzureCliCredential()); + this.credential); var result = new TaskCompletionSource(); using (token.Register(() => result.TrySetCanceled())) diff --git a/test/Microsoft.Azure.Devices.Edge.Test.Common/OsPlatform.cs b/test/Microsoft.Azure.Devices.Edge.Test.Common/OsPlatform.cs index 0346eb0f5f5..0b33debbdae 100644 --- a/test/Microsoft.Azure.Devices.Edge.Test.Common/OsPlatform.cs +++ b/test/Microsoft.Azure.Devices.Edge.Test.Common/OsPlatform.cs @@ -17,6 +17,8 @@ public class OsPlatform { public static readonly IOsPlatform Current = new Linux.OsPlatform(); + public static bool Is32Bit() => RuntimeInformation.OSArchitecture == Architecture.X86 || RuntimeInformation.OSArchitecture == Architecture.Arm; + public static bool Is64Bit() => RuntimeInformation.OSArchitecture == Architecture.X64 || RuntimeInformation.OSArchitecture == Architecture.Arm64; public static bool IsArm() => RuntimeInformation.OSArchitecture == Architecture.Arm || RuntimeInformation.OSArchitecture == Architecture.Arm64; From 390e14db20938d50a94a1bf74e93cf776463e599 Mon Sep 17 00:00:00 2001 From: Damon Barry Date: Wed, 22 Jul 2026 11:26:57 -0700 Subject: [PATCH 2/3] Update package manifests --- .../packages.lock.json | 6 +++--- test/Microsoft.Azure.Devices.Edge.Test/packages.lock.json | 8 ++++---- test/modules/ModuleLib/packages.lock.json | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/test/Microsoft.Azure.Devices.Edge.Test.Common/packages.lock.json b/test/Microsoft.Azure.Devices.Edge.Test.Common/packages.lock.json index 790f58cdca7..96f298d53be 100644 --- a/test/Microsoft.Azure.Devices.Edge.Test.Common/packages.lock.json +++ b/test/Microsoft.Azure.Devices.Edge.Test.Common/packages.lock.json @@ -40,9 +40,9 @@ }, "Microsoft.Azure.Devices.Client": { "type": "Direct", - "requested": "[1.43.0-edgeLts, 1.43.0-edgeLts]", - "resolved": "1.43.0-edgeLts", - "contentHash": "lmcZUT04unp09ZoY9RdXTHjjsZrKs1oFotyvOlZBpsYD06R0/CTpfjbuk54LOqkH0NDk2lErnPAH/+/FE04fMg==", + "requested": "[1.43.2-edgeLts, 1.43.2-edgeLts]", + "resolved": "1.43.2-edgeLts", + "contentHash": "Is/Fed8WHB6E97Hjk2bgKmxH3daVWpNrMX+lJ2ZNJlDlh3PWxgbd1QMETap0cp7ahpn13YXEzvsWmjuZ//XvrQ==", "dependencies": { "MQTTnet": "5.1.0.1559", "Microsoft.Azure.Amqp": "2.6.9", diff --git a/test/Microsoft.Azure.Devices.Edge.Test/packages.lock.json b/test/Microsoft.Azure.Devices.Edge.Test/packages.lock.json index 4c33f1c25ae..a8552e11396 100644 --- a/test/Microsoft.Azure.Devices.Edge.Test/packages.lock.json +++ b/test/Microsoft.Azure.Devices.Edge.Test/packages.lock.json @@ -198,8 +198,8 @@ }, "Microsoft.Azure.Devices.Client": { "type": "Transitive", - "resolved": "1.43.0-edgeLts", - "contentHash": "lmcZUT04unp09ZoY9RdXTHjjsZrKs1oFotyvOlZBpsYD06R0/CTpfjbuk54LOqkH0NDk2lErnPAH/+/FE04fMg==", + "resolved": "1.43.2-edgeLts", + "contentHash": "Is/Fed8WHB6E97Hjk2bgKmxH3daVWpNrMX+lJ2ZNJlDlh3PWxgbd1QMETap0cp7ahpn13YXEzvsWmjuZ//XvrQ==", "dependencies": { "MQTTnet": "5.1.0.1559", "Microsoft.Azure.Amqp": "2.6.9", @@ -708,7 +708,7 @@ "microsoft.azure.devices.edge.moduleutil": { "type": "Project", "dependencies": { - "Microsoft.Azure.Devices.Client": "[1.43.0-edgeLts, 1.43.0-edgeLts]", + "Microsoft.Azure.Devices.Client": "[1.43.2-edgeLts, 1.43.2-edgeLts]", "Microsoft.Azure.Devices.Edge.Util": "[1.0.0, )" } }, @@ -725,7 +725,7 @@ "Azure.Identity": "[1.17.1, )", "Azure.Messaging.EventHubs": "[5.12.2, )", "Microsoft.Azure.Devices": "[1.42.0-edgeLts, 1.42.0-edgeLts]", - "Microsoft.Azure.Devices.Client": "[1.43.0-edgeLts, 1.43.0-edgeLts]", + "Microsoft.Azure.Devices.Client": "[1.43.2-edgeLts, 1.43.2-edgeLts]", "Microsoft.Azure.Devices.Edge.Util": "[1.0.0, )", "Microsoft.Extensions.Configuration.Binder": "[10.0.0, )", "Microsoft.Extensions.Configuration.EnvironmentVariables": "[10.0.0, )", diff --git a/test/modules/ModuleLib/packages.lock.json b/test/modules/ModuleLib/packages.lock.json index 5b4b40b9c3a..525899f888a 100644 --- a/test/modules/ModuleLib/packages.lock.json +++ b/test/modules/ModuleLib/packages.lock.json @@ -4,9 +4,9 @@ "net10.0": { "Microsoft.Azure.Devices.Client": { "type": "Direct", - "requested": "[1.43.0-edgeLts, 1.43.0-edgeLts]", - "resolved": "1.43.0-edgeLts", - "contentHash": "lmcZUT04unp09ZoY9RdXTHjjsZrKs1oFotyvOlZBpsYD06R0/CTpfjbuk54LOqkH0NDk2lErnPAH/+/FE04fMg==", + "requested": "[1.43.2-edgeLts, 1.43.2-edgeLts]", + "resolved": "1.43.2-edgeLts", + "contentHash": "Is/Fed8WHB6E97Hjk2bgKmxH3daVWpNrMX+lJ2ZNJlDlh3PWxgbd1QMETap0cp7ahpn13YXEzvsWmjuZ//XvrQ==", "dependencies": { "MQTTnet": "5.1.0.1559", "Microsoft.Azure.Amqp": "2.6.9", From 0136402690aee011304a635ffce80e8f329474c2 Mon Sep 17 00:00:00 2001 From: Damon Barry Date: Wed, 22 Jul 2026 11:29:25 -0700 Subject: [PATCH 3/3] Fix formatting --- .../IotHub.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/Microsoft.Azure.Devices.Edge.Test.Common/IotHub.cs b/test/Microsoft.Azure.Devices.Edge.Test.Common/IotHub.cs index acdb331b756..36b4f2006cd 100644 --- a/test/Microsoft.Azure.Devices.Edge.Test.Common/IotHub.cs +++ b/test/Microsoft.Azure.Devices.Edge.Test.Common/IotHub.cs @@ -87,11 +87,11 @@ public IotHub(string iotHubHostname, string eventHubName, string eventHubNamespa async Task GetEventHubPartitionCountAsync() { await using var consumer = new EventHubConsumerClient( - EventHubConsumerClient.DefaultConsumerGroupName, - this.eventHubNamespace, - this.eventHubName, - this.credential, - consumerOptions); + EventHubConsumerClient.DefaultConsumerGroupName, + this.eventHubNamespace, + this.eventHubName, + this.credential, + consumerOptions); string[] partitionIds = await consumer.GetPartitionIdsAsync(); return partitionIds.Length; @@ -123,7 +123,7 @@ public async Task CreateDeviceIdentityAsync(Device device, CancellationT // identity and recreate so the repro run isn't blocked by leftover state. Log.Warning($"Device identity '{device.Id}' already exists; deleting orphaned identity and recreating."); await this.RegistryManager.RemoveDeviceAsync(device.Id, token); - return await this.RegistryManager.AddDeviceAsync(device, token); + return await this.RegistryManager.AddDeviceAsync(device, token); } }