Skip to content

Tests that make sure user provided implementations of interfaces have expected ServiceLifetime #757

Closed
@martinothamar

Description

@martinothamar

Description

If an app developer registers an IInstanceProcessor as Transient, we should always instantiate it transiently (not accidentally make it a singleton by rooting it in some other service). Ideally we would not have to, but this is the least surprising behavior as app devs typically aren't concerned with what they put in constructors (ref the IHttpContextAccessor leak incident).

We should develop tests that ensure that all (commonly implemented) public interfaces live for the expected duration.

Additional Information

No response

Tasks

  • Get a list of common user-implementable interfaces which we should develop lifetime tests for
  • Implement tests

Acceptance Criterias

  • When IInstantiationProcessor services are registrered as Transient, they are instantiated with each invocation of IProcessEventHandlerDelegator (or downstream services/deps) methods
  • The above criteria should be true for any other user implemented interface

Metadata

Metadata

Assignees

Type

No type

Projects

Status

✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions