Skip to content

Unit test failures and ArgumentNullException with .NET 10.0.100-preview.7.25351.101 SDK #2327

@CancanTang

Description

@CancanTang

Just a heads up

Summary

When running Ocelot unit and acceptance tests using dotnet-sdk-10.0.100-preview.7.25351.101, two tests fail, after investigation, it is caused by the breaking change dotnet/docs#46890 .If you'd like to work around this on your end, you can either handle null values in your code or update your configuration files to use empty strings instead of null, e.g.:
"ServiceName": ""

Details

  • SDK: dotnet-sdk-10.0.100-preview.7.25351.101
  • OS: Windows 11 24H2 x64
  • Test Project: Ocelot.AcceptanceTests.dll
  • Failing Tests:
    • Ocelot.AcceptanceTests.WebSocketTests.ShouldProxyWebsocketInputToDownstreamServiceAndUseLoadBalancer
    • Ocelot.AcceptanceTests.LoadBalancerTests.Should_load_balance_request_with_round_robin

Reproduction Steps

  1. Install only dotnet-sdk-10.0.100-preview.7.25351.101 and set DOTNET_ROLL_FORWARD_ON_NO_CANDIDATE_FX=2.
  2. Update Ocelot.AcceptanceTests.runtimeconfig.json frameworks section to reference SDK 10.0.0-preview.7.25351.101.
  3. Build and run the acceptance tests with dotnet vstest Ocelot.AcceptanceTests.dll.
  4. Observe the two test failures described below.

Error Messages

it will will throw "System.ArgumentNullException: 'Value cannot be null. (Parameter 'key')'" exception from source code.

Tests pass on:

  • dotnet-sdk-8.0.411
  • dotnet-sdk-10.0.100-preview.6.25326.107
  • Fail on:
    • dotnet-sdk-10.0.100-preview.7.25351.101

Additional Findings

  • In previous SDK versions, the parameter passed to TryScanNext() in RoundRobin.cs was an empty string. In preview 7 it is now null, causing the ArgumentNullException.

Please get details from dotnet/runtime#117316 .

Metadata

Metadata

Assignees

No one assigned

    Labels

    NET10.NET 10 releasebugIdentified as a potential bug

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions