Upgrade test/sample projects to .NET 8.0 and bump dependencies#1323
Upgrade test/sample projects to .NET 8.0 and bump dependencies#1323berndverst merged 12 commits intoAzure:mainfrom
Conversation
- Retarget all test projects from net6.0 to net8.0 (net48 multi-target preserved) - Retarget all sample projects from net6.0 to net8.0 - Update framework-conditional ItemGroups in Directory.Packages.props - Apply pending dependabot package updates: - Azure.Storage.Blobs 12.24.0 -> 12.27.0 - Azure.Monitor.OpenTelemetry.Exporter 1.0.0-beta.4 -> 1.6.0 - Azure.Identity 1.12.0 -> 1.18.0 - Microsoft.ApplicationInsights 2.21.0 -> 2.23.0 - System.Text.RegularExpressions 4.3.1 (security pin) - Bump transitive dependencies to resolve NU1605 downgrades: - Microsoft.Bcl.AsyncInterfaces 6.0.0 -> 8.0.0 - System.Text.Json 6.0.10 -> 10.0.3 - Microsoft.Extensions.Logging* 8.0.0 -> 10.0.3 (net8.0) - Fix compilation issues from API changes: - Add explicit parameters for Blob API calls (12.27.0 removed defaults) - Suppress SYSLIB0050/0051 for obsolete formatter serialization in tests - Suppress CS8633/CS8766 for ILogger.BeginScope nullability changes
There was a problem hiding this comment.
Pull request overview
Upgrades the repository’s test and sample projects to target .NET 8 while consolidating Dependabot-driven dependency bumps and adjusting call sites / pragmas to keep builds clean under updated APIs.
Changes:
- Retargeted test projects from
net6.0tonet8.0(while preservingnet48where applicable) and upgraded sample projects tonet8.0. - Updated central package versions (and framework-conditional package selections) in
Directory.Packages.props. - Applied compilation fixes for updated Azure SDK method signatures and .NET 8 obsoletions via explicit parameters and targeted warning suppressions.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/DurableTask.Stress.Tests/DurableTask.Stress.Tests.csproj | Retarget stress tests to net8.0;net48. |
| test/DurableTask.ServiceBus.Tests/DurableTask.ServiceBus.Tests.csproj | Retarget to net8.0;net48 and update ItemGroup conditions from net6.0 → net8.0. |
| test/DurableTask.Emulator.Tests/DurableTask.Emulator.Tests.csproj | Retarget emulator tests to net8.0;net48. |
| test/DurableTask.Core.Tests/WorkItemDispatcherTests.cs | Suppress logging nullability warnings for multi-target compatibility. |
| test/DurableTask.Core.Tests/ExceptionHandlingIntegrationTests.cs | Suppress obsolete serialization warnings for .NET 8. |
| test/DurableTask.Core.Tests/DurableTask.Core.Tests.csproj | Retarget core tests to net8.0;net48. |
| test/DurableTask.Core.Tests/CustomExceptionsTests.cs | Suppress obsolete formatter-based serialization warnings for test-only serialization logic. |
| test/DurableTask.AzureStorage.Tests/Obsolete/LegacyTableEntityConverter.cs | Suppress obsolete FormatterServices usage warning in legacy converter used by tests. |
| test/DurableTask.AzureStorage.Tests/DurableTask.AzureStorage.Tests.csproj | Retarget storage tests to net8.0;net48 and add a security pin package reference. |
| test/DurableTask.AzureStorage.Tests/AzureStorageScenarioTests.cs | Adjust blob listing calls to pass explicit defaults after SDK signature changes. |
| test/DurableTask.AzureStorage.Tests/AzureStorageScaleTests.cs | Adjust blob listing call to pass explicit defaults after SDK signature changes. |
| samples/ManagedIdentitySample/DTFx.AzureStorage v1.x/ManagedIdentity.AzStorageV1.csproj | Retarget sample to net8.0. |
| samples/DistributedTraceSample/OpenTelemetry/OpenTelemetrySample.csproj | Retarget sample to net8.0. |
| samples/DistributedTraceSample/ApplicationInsights/ApplicationInsightsSample.csproj | Retarget sample to net8.0. |
| samples/Correlation.Samples/Correlation.Samples.csproj | Retarget sample to net8.0. |
| Directory.Packages.props | Central package version bumps + framework-conditional dependency updates for the .NET 8 move. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
test/DurableTask.AzureStorage.Tests/Obsolete/LegacyTableEntityConverter.cs
Show resolved
Hide resolved
- Fix GetBlobsByHierarchyAsync delimiter from null to '/' to preserve hierarchy semantics - Add explanatory comment for SYSLIB0050 suppression in LegacyTableEntityConverter
- Replace .NET 6 SDK install with .NET 8 in Azure DevOps build-steps.yml - Add .NET 8 SDK setup step in CodeQL GitHub Actions workflow
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 18 out of 18 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
test/DurableTask.Core.Tests/ExceptionHandlingIntegrationTests.cs:1
- These warning suppressions cover multiple members at once. To reduce the risk of accidentally hiding new warnings added later, scope the
#pragma warning disable/restoreas tightly as possible (e.g., wrap only the serialization ctor and the specificGetObjectDataoverride line/block that triggers the warning, or use member-level suppression attributes).
// ----------------------------------------------------------------------------------
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…coping - Use #if NET8_0_OR_GREATER for BeginScope<TState> to match ILogger contract per TFM - Split pragma suppressions for serialization ctor and GetObjectData into separate blocks
Azure Storage tests exceed the default 60-minute job timeout due to the larger test suite and Azurite emulator startup overhead.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 19 out of 19 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Increase DTFxASValidate job timeout from 90 to 150 minutes - Update VSTest version from 17.0 to latest for better .NET 8 test runtime support
The previous fix changed delimiter from null (the SDK default) to '/' per a review suggestion. However, with delimiter='/' and prefix without a trailing slash, blobs are returned as virtual directory prefixes (IsBlob=false) rather than blob items, causing the Where(x => x.IsBlob) filter to return no results.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 20 out of 20 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
test/DurableTask.AzureStorage.Tests/DurableTask.AzureStorage.Tests.csproj
Show resolved
Hide resolved
…ation Move service.CreateAsync() from TestOrchestrationHost constructor (where it blocked synchronously via .GetAwaiter().GetResult()) to StartAsync() (where it is properly awaited). This eliminates the primary source of threadpool starvation when many tests run in parallel under .NET 8. Also convert remaining .Result and .GetAwaiter().GetResult() calls to proper await patterns in AzureStorageScaleTests and TestTablePartitionManager.
…ion, add pragma comments - Condition System.Text.RegularExpressions PackageReference on net48 only - Revert vsTestVersion from 'latest' back to '17.0' for CI reproducibility - Add justification comments on SYSLIB0051 pragma suppressions in ExceptionHandlingIntegrationTests.cs
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 22 out of 22 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Reduce TestHelpers LoggerFactory console log level from Trace to Warning to reduce contention from verbose output under Microsoft.Extensions.Logging 10.x. Remove the 150-minute timeout override (revert to default) since the sync-over-async fix should prevent threadpool starvation hangs.
Azure.Storage.Blobs 12.27.0 uses API version 2026-02-06 which is not supported by the Azurite version installed in CI via 'npm install -g azurite'. This causes tests to hang as the SDK's retry logic repeatedly fails. Add --skipApiVersionCheck to the Azurite startup command to allow the newer API version to work with the installed Azurite version.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 22 out of 22 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The BaseProcessor<T> in OpenTelemetry SDK 1.14.0 (transitive from Azure.Monitor.OpenTelemetry.Exporter 1.6.0) changed method signatures - OnShutdown and OnForceFlush now take int timeoutMilliseconds parameters. This broke the hard-coded processor.Invocations[index] pattern which assumed fixed invocation ordering. Replace fragile index-based access with filtering for OnEnd method invocations, which gives us only the completed Activity objects regardless of SDK-internal invocation changes.
Summary
Upgrades all test and sample projects from
net6.0tonet8.0and applies all pending Dependabot package updates, resolving transitive dependency downgrades and compilation issues along the way.Changes
🎯 Framework Upgrade:
net6.0→net8.0Test projects (multi-target
net8.0;net48preserved):DurableTask.Core.TestsDurableTask.AzureStorage.TestsDurableTask.ServiceBus.TestsDurableTask.Emulator.TestsDurableTask.Stress.TestsSample projects (single-target
net8.0):Correlation.SamplesOpenTelemetrySampleApplicationInsightsSampleManagedIdentity.AzStorageV1Directory.Packages.props— Updated framework-conditionalItemGroupconditions fromnet6.0tonet8.0(CommandLineParser, WindowsAzure.Storage, SemanticLogging.NetCore sections).DurableTask.ServiceBus.Tests.csproj— Updatednet6.0-specificItemGroupconditions tonet8.0.📦 Dependabot Package Updates
Applies the following pending Dependabot PRs in a single consolidated change:
Azure.Storage.BlobsAzure.Monitor.OpenTelemetry.ExporterAzure.IdentityMicrosoft.ApplicationInsightsSystem.Text.RegularExpressions🔧 Transitive Dependency Bumps (NU1605 resolution)
The Dependabot updates pulled in newer transitive dependencies, causing
NU1605package downgrade errors. The following were bumped to match:Microsoft.Bcl.AsyncInterfacesAzure.Core1.50.0System.Text.JsonMicrosoft.Extensions.Logging.Console10.0.3; also fixes known CVEs in 8.0.0Microsoft.Extensions.Logging*Azure.Identity1.18.0 →Microsoft.Extensions.Hosting.Abstractions10.0.3 (net8.0 condition only)🛠️ Compilation Fixes
Azure.Storage.Blobs 12.27.0 — Removed default parameter values
BlobContainerClient.GetBlobsAsync()andGetBlobsByHierarchyAsync()no longer have default parameter values in 12.27.0 (method signatures are identical, only the defaults were removed). Affected call sites now pass the previous implicit defaults explicitly:AzureStorageScaleTests.cs—GetBlobsAsync(traits: BlobTraits.None, states: BlobStates.None, prefix: ..., cancellationToken: default)AzureStorageScenarioTests.cs(×2) — Same pattern forGetBlobsAsyncandGetBlobsByHierarchyAsync.NET 8 obsolete serialization APIs (SYSLIB0050/0051)
Formatter-based serialization APIs (
FormatterServices,ISerializable.GetObjectData) are obsolete in .NET 8. Added targeted#pragma warning disable/restorein test files:CustomExceptionsTests.cs—SYSLIB0050forFormatterConverter,SYSLIB0051forGetObjectDataExceptionHandlingIntegrationTests.cs—SYSLIB0051, CS0672for serialization constructors andGetObjectDataoverridesLegacyTableEntityConverter.cs—SYSLIB0050forFormatterServices.GetUninitializedObjectILogger.BeginScope nullability change (CS8633/CS8766)
Microsoft.Extensions.Logging10.0.3 changed the nullability constraint onILogger.BeginScope<TState>. Added pragma suppression inWorkItemDispatcherTests.cssince the mock logger must compile against bothnet48(v6.0.0) andnet8.0(v10.0.3) targets.Build Verification
✅
dotnet build DurableTask.sln— 0 errors, 0 warningsRelated Dependabot PRs
This PR supersedes the following Dependabot PRs: