Skip to content

Conversation

tillig
Copy link
Contributor

@tillig tillig commented Apr 25, 2022

Fix #67391

Adds Microsoft.Extensions.DependencyInjection.Specification.Tests for ensuring:

  • IServiceScopeFactory is a singleton.
  • Dependency injection scopes are flat, not hierarchical structure.

Autofac, Grace, and DryIoc all fail one or both of these tests. Changes include adding explicit skip for the failing tests on those external containers.

Also switched the IServiceProviderIsService tests on for Autofac since that is supported. All of those tests pass.

tillig added 3 commits April 25, 2022 12:59
Add DI specification tests to ensure that conforming container
implementations:

- Implement IServiceScopeFactory as a singleton.
- Provide service scopes that all branch from the container and are not
  hierarchical.

Fix dotnet#67391
@ghost ghost added area-Extensions-DependencyInjection community-contribution Indicates that the PR has been added by a community member labels Apr 25, 2022
@ghost
Copy link

ghost commented Apr 25, 2022

Tagging subscribers to this area: @dotnet/area-extensions-dependencyinjection
See info in area-owners.md if you want to be subscribed.

Issue Details

Fix #67391

Adds Microsoft.Extensions.DependencyInjection.Specification.Tests for ensuring:

  • IServiceScopeFactory is a singleton.
  • Dependency injection scopes are flat, not hierarchical structure.

Autofac, Grace, and DryIoc all fail one or both of these tests. Changes include adding explicit skip for the failing tests on those external containers.

Also switched the IServiceProviderIsService tests on for Autofac since that is supported. All of those tests pass.

Author: tillig
Assignees: -
Labels:

area-Extensions-DependencyInjection

Milestone: -

Tests fail during CI build but succeed locally. Reverting change to
troubleshoot later.
Copy link
Member

@eerhardt eerhardt left a comment

Choose a reason for hiding this comment

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

This looks good to me. Thanks for the contribution and raising this issue.

@danmoseley danmoseley merged commit 64807b3 into dotnet:main Apr 27, 2022
@tillig tillig deleted the issue-67391 branch May 24, 2022 22:44
@ghost ghost locked as resolved and limited conversation to collaborators Jun 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-Extensions-DependencyInjection community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

IServiceScopeFactory is Documented Assumed to be a Singleton

4 participants