Skip to content

#2327 Handle null service name in RoundRobin constructor#2350

Closed
SharaawyMohamed wants to merge 3 commits intoThreeMammals:developfrom
SharaawyMohamed:fix/roundrobin-null-service-name
Closed

#2327 Handle null service name in RoundRobin constructor#2350
SharaawyMohamed wants to merge 3 commits intoThreeMammals:developfrom
SharaawyMohamed:fix/roundrobin-null-service-name

Conversation

@SharaawyMohamed
Copy link
Copy Markdown

@SharaawyMohamed SharaawyMohamed commented Dec 28, 2025

Fixes #2327

Proposed Changes

  • Converts null service names to empty string
  • Prevents ArgumentNullException when IConfiguration returns null

- Fixes ThreeMammals#2327: Unit test failures with .NET 10.0.100-preview.7
- Converts null service names to empty string
- Prevents ArgumentNullException when IConfiguration returns null
ArgumentNullException.ThrowIfNull(services);
_servicesDelegate = services;
_serviceName = serviceName;
_serviceName = serviceName?? string.Empty;
Copy link
Copy Markdown
Member

@raman-m raman-m Dec 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, is this really the bug fix? 🤣
It doesn’t seem related to the .NET SDK version. Can it be reproduced in .NET 9?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are the CI tests failing when all tests pass successfully on my local machine?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't warry, the build is green now. Use "Re-run job" button.

Why are the CI tests failing when all tests pass successfully on my local machine?

Yes, tests pass reliably locally and remain stable in the CI environment. A few CPU-sensitive tests might occasionally fail even on local runs, but overall, the tests are optimized to perform well in both environments.
The fact is, we have many tests in Ocelot Core that run parallel logic and are sensitive to thread synchronization. Syncing threads can be unpredictable, but usually, a simple re-run does the trick.

@coveralls
Copy link
Copy Markdown
Collaborator

coveralls commented Jan 1, 2026

Coverage Status

coverage: 93.632%. remained the same
when pulling fce8d61 on SharaawyMohamed:fix/roundrobin-null-service-name
into b8cc478 on ThreeMammals:develop.

@raman-m raman-m changed the title Fix: Handle null service name in RoundRobin constructor #2327 Handle null service name in RoundRobin constructor Jan 1, 2026
@raman-m
Copy link
Copy Markdown
Member

raman-m commented Jan 1, 2026

Will you hold off on adding the net10.0 TFM to the projects?
The problem now is that it’s impossible to verify if the fix works without the net10.0 TFM.

@raman-m raman-m added bug Identified as a potential bug DevOps DevOps tasks: CI-CD, environments, and other scripts, configurations NET10 .NET 10 release labels Jan 21, 2026
@raman-m raman-m added this to the .NET 10 milestone Jan 21, 2026
@raman-m
Copy link
Copy Markdown
Member

raman-m commented Jan 29, 2026

@SharaawyMohamed
Please check the linked issue. I’ve closed it because I couldn’t reproduce the bug, and all acceptance tests are passing after upgrading to .NET 10. Do you think this pull request still makes sense?

@raman-m raman-m closed this Jan 30, 2026
@SharaawyMohamed SharaawyMohamed deleted the fix/roundrobin-null-service-name branch February 27, 2026 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Identified as a potential bug DevOps DevOps tasks: CI-CD, environments, and other scripts, configurations NET10 .NET 10 release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

3 participants