Follow-up from #451 (FT-2, #307).
Problem
FT-2 claims a behavioural fix that nothing asserts: because the handler list is owned by BuildContext and discarded on dispose, BuildExecutor's ExecuteAssuredTargets subscription — never explicitly unsubscribed — no longer survives across in-process invocations.
That's the one externally-visible improvement in the PR, and it has no test. A regression would be silent, and it only shows up in the multi-Execute-per-process scenarios (specs, hosted runners) that are hardest to notice breaking.
Related: BuildContext.Dispose unsubscribing Console.CancelKeyPress and ToolOptions.Created is also unasserted. ToolOptions.Created is reachable from a spec (it fires from ToolOptions' constructor), though the observable is VerbosityMapping.Apply setting a mapped property; Console.CancelKeyPress isn't raisable at all. Fold in if the seam from #545 makes it cheap.
Outcome
Running two builds in one process demonstrably starts the second with no handlers carried over from the first.
Acceptance criteria
Follow-up from #451 (FT-2, #307).
Problem
FT-2 claims a behavioural fix that nothing asserts: because the handler list is owned by
BuildContextand discarded on dispose,BuildExecutor'sExecuteAssuredTargetssubscription — never explicitly unsubscribed — no longer survives across in-process invocations.That's the one externally-visible improvement in the PR, and it has no test. A regression would be silent, and it only shows up in the multi-
Execute-per-process scenarios (specs, hosted runners) that are hardest to notice breaking.Related:
BuildContext.DisposeunsubscribingConsole.CancelKeyPressandToolOptions.Createdis also unasserted.ToolOptions.Createdis reachable from a spec (it fires fromToolOptions' constructor), though the observable isVerbosityMapping.Applysetting a mapped property;Console.CancelKeyPressisn't raisable at all. Fold in if the seam from #545 makes it cheap.Outcome
Running two builds in one process demonstrably starts the second with no handlers carried over from the first.
Acceptance criteria
BuildManager.Executetwice in-process and asserts the second run starts with no handlers left from the first.internalaccessibility beyond the test assemblies.