Skip to content

0.63.0 broke property injection #3266

@seahurricanelemonade

Description

@seahurricanelemonade

I'm unable to provide code unfortunately but I can describe the scenario.

I have a test which inherits from an abstract class (B) that also inherits from an abstract class (A)

B has a proprety injected which is a Pulsar connection implementation that has SharedType.None. The pulsar connection class also has another property injected which is a Pulsar test container with SharedType.PerTestSession.

A has a property injected which is based off WebApplicationFactory with ShareType.None. The WebApplicationFactory also has a property injected which is the Pulsar test container with SharedType.PerTestSession.

Running a test and it fails to initialise the Pulsar test container in time for use by the Pulsar connection class.

       at TUnit.Core.ObjectInitializer.GetInitializationTask(Object obj, IAsyncInitializer asyncInitializer)
   at TUnit.Core.ObjectInitializer.InitializeAsync(Object obj, CancellationToken cancellationToken)
   at TUnit.Engine.Services.PropertyInitializationOrchestrator.InitializeObjectWithPropertiesAsync(Object instance, PropertyInjectionPlan plan, Dictionary`2 objectBag, MethodMetadata methodMetadata, TestContextEvents events, ConcurrentDictionary`2 visitedObjects)
   at TUnit.Engine.Services.PropertyInjectionService.<>c__DisplayClass5_0.<<InjectPropertiesIntoObjectAsyncCore>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at TUnit.Engine.Services.PropertyInjectionService.InjectPropertiesIntoObjectAsyncCore(Object instance, Dictionary`2 objectBag, MethodMetadata methodMetadata, TestContextEvents events, ConcurrentDictionary`2 visitedObjects)
Stack trace:    at TUnit.Engine.Services.PropertyInjectionService.InjectPropertiesIntoObjectAsyncCore(Object instance, Dictionary`2 objectBag, MethodMetadata methodMetadata, TestContextEvents events, ConcurrentDictionary`2 visitedObjects)
   at TUnit.Engine.Services.PropertyInjectionService.InjectPropertiesIntoObjectAsyncCore(Object instance, Dictionary`2 objectBag, MethodMetadata methodMetadata, TestContextEvents events, ConcurrentDictionary`2 visitedObjects)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions