You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unit-test external-ownership marking in tracking discovery, including an object reached by both paths #7376
PR #7328 (fixing #7205) gave ObjectGraphDiscoverer's tracking discovery a heldByExternalOwner flag, an injectedValues set, and a second traversal, so IAsyncInitializer objects beneath a scope-owned service are marked externally owned while values of TUnit-injected data-source properties stay with the tracker.
Coverage today is integration-level, in tests/TUnit.TestProject/Bugs/_7205:
an IAsyncInitializer dependency beneath a scope-owned service (NestedScopeDependencyTests), disposed exactly once;
a TUnit-injected IAsyncInitializer beneath a scope-owned service (NestedProbeService.Fixture), disposed exactly once.
Not covered: one object reached by both paths in the same graph, once as an injected property value and once as an IAsyncInitializer property of a scope-owned service. Nothing pins which owner wins.
Raised by the Claude review on #7328 (head ca412cb, item 4).
Acceptance criteria
Unit tests in tests/TUnit.UnitTests cover the three cases above directly against the discoverer, including the shared-object case, in source-generated and reflection property registries.
The shared-object case asserts that the tracker keeps an object that a TUnit-injected property supplies, and disposes it exactly once.
Blocked by #7382 (the ownership portion of replacement PR #7384). PR #7328 was closed without merging. Its implementation and review remain historical context.
Triage: #7328 was closed without merging. Its external-ownership implementation is now in open PR #7384, which closes #7382. Replaced the broad #7205 parent dependency with #7382 so this follow-up can proceed as soon as ownership lands, without waiting for unrelated session-lifetime work in #7383. The requested work is still absent from main d8badac.
The replacement ownership implementation in #7635 carries forward the complete direct test suite from #7634 and adapts it to row scope owner handles. Its eight cases pass in both source-generated and reflection execution, with explicit property-registry checks. #7634 is closed as superseded; #7635 now closes this issue alongside #7378.
Activity
thomhurst commentedon Nov 2, 2026
Triage: #7328 was closed without merging. Its external-ownership implementation is now in open PR #7384, which closes #7382. Replaced the broad #7205 parent dependency with #7382 so this follow-up can proceed as soon as ownership lands, without waiting for unrelated session-lifetime work in #7383. The requested work is still absent from main d8badac.
thomhurst commentedon Nov 5, 2026
The replacement ownership implementation in #7635 carries forward the complete direct test suite from #7634 and adapts it to row scope owner handles. Its eight cases pass in both source-generated and reflection execution, with explicit property-registry checks. #7634 is closed as superseded; #7635 now closes this issue alongside #7378.