Skip to content

Restructure TestAgentService and agent providers - #1964

Merged
CharliePoole merged 4 commits into
mainfrom
issue-1726
Nov 15, 2026
Merged

CharliePoole merged 4 commits into
mainfrom
issue-1726

Conversation

@CharliePoole

Copy link
Copy Markdown
Member
  • Providers are now independent services
  • TestAgentService coordinates all providers installed
  • Local provider is server to local process clients
  • Local provider manages AgentStore
  • In-process and remote process providers are placeholders

* Providers are now independent services
* TestAgentService coordinates all providers installed
* Local provider is server to local process clients
* Local provider manages AgentStore
* In-process and remote process providers are placeholders
@CharliePoole CharliePoole added this to the 4.0.0-beta.6 milestone Nov 13, 2026
@CharliePoole
CharliePoole marked this pull request as draft November 13, 2026 12:40
@CharliePoole

Copy link
Copy Markdown
Member Author

@oznetmaster Putting this up as a draft so you can take a look at the design changes in TestAgentService and its providers.

Once I resolve the merge conflicts, we could merge this in order to have the structural changes available for you as well, so please take a look at the code in that light and let me know what you think. I'll ask for a new review once the conflicts are resolved.

Still remaining to be done...

  • Bundle the .NET 9.0 agent, which also has merge conflicts.
  • Complete the implementation of in-process provider

Copy link
Copy Markdown
Collaborator

@CharliePoole, I agree with the structural direction. Independent provider services, a coordinating TestAgentService and local-only AgentStore ownership fit our remote implementation well. Separating this structural slice from completing in-process execution makes sense.

I built this draft and its five new coordinator tests pass. Additional isolated checks exposed three points to address before merging:

  1. Both GetService<ITestAgentProvider>() and GetService<ITestAgentInfo>() currently return LocalProcessAgentProvider because it is registered first. Existing public callers consequently bypass the coordinator’s aggregate. We should preserve coordinator lookup while using GetServices<T>() to discover its subordinate providers.

  2. OnAgentExit throws for a nonzero exit from the Process.Exited callback. A controlled probe against the actual method produced an unhandled exception on the callback thread and terminated the probe process. I would have the callback record termination and notify safely; acquisition/runner operations can report the failure on their normal calling threads. This fits the provider-to-coordinator exit notification we discussed.

  3. Restarting TestAgentService appends its providers again—the probe’s advertised count doubled. Rebuilding the provider snapshot should prevent duplication. GetAgentExitMessage should also take its ownership snapshot under the existing dictionary lock, releasing it before provider I/O.

I can adapt the disabled ownership/exit/release regressions to service registration rather than their old constructor and AgentStore assumptions. That would restore completed behavior coverage without requiring completion of the pending in-process feature.

The API enumeration work also overlaps #1963; we can retain the relevant tests and reconcile that draft as this settles. I’ll wait for your conflict resolution and requested rereview. No merges meanwhile.

Neil Colvin, with assistance from OpenAI Codex.

Copy link
Copy Markdown
Collaborator

@CharliePoole, the disabled ownership, exit and local-release fixtures are now adapted to the registered-provider structure at 5a0aa308. The test-only change uses ServiceContext startup/shutdown and retains the original return/retry, reference identity, concurrent release and runner disposal checks. Native liveness checks now belong to the local provider; coordinator ownership persists until return succeeds.

Both Windows test targets build without warnings. The complete Unit selections have no failures (390 executed passes on .NET 10 and 398 on .NET Framework, with seven existing skips each). The 54-case focused selection passes ownership/release checks but exposes the same eight nonzero-exit callback failures on each runtime. With a separate temporary change that logs rather than throws from OnAgentExit, all 54 pass on each runtime. That production change is outside the adaptation patch.

The restored server helper also passes its 11 loopback cases on both runtimes with its existing Ignore temporarily removed for the control. The Ignore and production source are restored unchanged. All owned child processes are gone.

I have posted the test-only adaptation as draft #1965, based directly on your issue-1726 branch, so it can follow your conflict resolution without interfering with your work. No merges. The public service lookup, restart snapshot and diagnostic-locking findings remain separate from this test migration.

Neil Colvin, with assistance from OpenAI Codex.

@CharliePoole

Copy link
Copy Markdown
Member Author

@oznetmaster Thanks for your comments. I'm in agreement that we should get this structural work merged before moving on to the actual in-process implementation in a separate PR, keeping #1726 open until then.

I'll look at the three points you listed but I need a bit more explanation regarding the third... There's no provision in the current implementation for stopping and restarting a service. Of course, a test can generally do so, but that would be based on the idea that it should be supported. I'm wondering if this can be handled by managing visibility of the classes and/or the interfaces.

Looking at #1963, I see you noticed the same problem I emailed about yesterday and have a solution I'll look at that as well.

And wait... #1965 just popped up for me as well, so I'll look at that and whatever pops up in addition. :-)

@CharliePoole

Copy link
Copy Markdown
Member Author

Second commit resolves conflicts. One more to come, adding back .NET 9.0 bundled agent after I resolve that merge.

Copy link
Copy Markdown
Collaborator

@CharliePoole, you’re right about restarting services. My probe demonstrated what happens if StartService is called again; it did not establish that restart is part of the supported lifecycle. I should have separated that observation from the merge concerns. We need not introduce restart support for this structural change, and #1965 adds no restart requirement.

The ownership-locking concern is independent of restart: GetAgentExitMessage reads the dictionary that GetAgent and ReturnAgent modify under a lock. I suggest taking the ownership snapshot under that same lock, then releasing it before querying the provider or waiting for process exit.

I checked the conflict-resolution commit: its source tree is identical to the version we tested, so those results remain applicable, including the callback failures. I’ll wait for the remaining .NET 9 agent update and your requested rereview. No merges meanwhile.

Neil Colvin, with assistance from OpenAI Codex.

@CharliePoole

Copy link
Copy Markdown
Member Author

@oznetmaster FYI, one source of conflict... as each agent is converted to support the .NET Core runner, one build needs to use generic CreateDelegate and the other non-generic. It took me a while to spot that. Currently, however, I'm running into errors with the DotNetExecutable tests. I'm suspecting that the environment variables used for isolation are becoming corrupted, even though I see the code to restore them in TearDown. I'll debug through after supper.

Copy link
Copy Markdown
Collaborator

@CharliePoole, I checked the updated .NET 9 agent branch. Its complete suites pass 74/74 on both Windows targets, including DotNetExecutableTests.

I also exercised the actual isolation fixture through 100 cases in one .NET 10 process. After every case, both environment variables were restored, the default helper’s cached directories were unchanged, the delegate belonged to a separate helper assembly, and the temporary directory was removed.

That does not explain the failure you saw. If it persists, could you share the failing assertion, target framework and how the tests were invoked? Those details should let me investigate the same conditions rather than infer environment corruption.

Neil Colvin, with assistance from OpenAI Codex.

@CharliePoole

Copy link
Copy Markdown
Member Author

My guess is that the error crept in because you did some validation work at a point in time when the .NET 10.0 launcher was not present in the .NET 9.0 agent. It was the only one of the four missing that change. I worked on adding the additional launcher separately and got a bit confused when trying to reconcile the two sets of changes. This is all corrected now. Each agent has an agent assembly targeting the runtime for which it is named and two launcher assemblies for net462 and net10.0, to correspond with our two runner platforms.

I'll do one more commit on this PR, to make use of the .NET 9.0 agent, and then we'll be able to merge it.

@CharliePoole

Copy link
Copy Markdown
Member Author

@oznetmaster Ready for review

@oznetmaster oznetmaster left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@CharliePoole, I re-reviewed 453add3. The .NET 9 agent is restored at 4.1.4-alpha.0.4. Both Windows test targets build cleanly, and the five coordinator tests pass on each.

I support the structural direction. These corrections remain before approval:

  1. Public GetService<ITestAgentProvider>() and GetService<ITestAgentInfo>() still return LocalProcessAgentProvider rather than TestAgentService. Preserve coordinator lookup while enumerating subordinate providers separately.
  2. OnAgentExit still throws on a nonzero exit. A fresh isolated .NET 10 callback probe terminated with an unhandled exception from this method. Record termination and notify without throwing out of the callback; acquisition and runner calls can report the failure normally.
  3. GetAgentExitMessage reads the ownership dictionary without the lock used by acquisition and return. Take the ownership snapshot under that lock, then release it before provider or native-process I/O.

These require neither restart support nor completion of the in-process provider. The restart observation is withdrawn as a blocker. I’ll recheck your corrective commit before approval.

For the remaining PRs, I suggest #1963 and #1965 first, to reconcile the overlapping API work and restore lifecycle tests; then #1947, #1937, and finally the separate #1962 server draft.

No merges from me until the synchronization all-clear.

Neil Colvin, with assistance from OpenAI Codex.

Copy link
Copy Markdown
Collaborator

@CharliePoole, I have now executed the combined registered-service/remote-provider candidate natively on macOS ARM64 and Linux ARM64, both on CLR 10.0.13. All 43 focused cases pass on each, including public engine routing and staged tests executed by real published backend agents. These are loopback backend processes on each native host, not new processor or WAN tests.

The complete required engine suite records 563 passed, two failed and eight existing skips on each host. Both failures are RuntimeFrameworkServiceTests.SelectRuntimeFramework for net462 (ordinary/x86): expected .NETFramework,Version=v4.6.2, actual .NETFramework,Version=v10.0.

The fallback retains targetIdentifier while replacing targetVersion with the current CoreCLR version. As a controlled comparison, I rebuilt only RuntimeFrameworkService.cs using its exact original source from your #1964 head 453add3; both tests reproduce the same failure on both hosts. This is a component control, not a claim to have run an unchanged whole-upstream baseline. The candidate source and binaries are restored exactly, and the failed reports remain failed.

I suggest keeping this local-runtime-selection policy separate from the remote-provider changes. We need an explicit outcome for a Framework target that has no supported local runtime, rather than manufacturing a Framework 10 target. I have made no policy correction or test waiver. The private integration is still based on your proposed structure and awaits reconciliation with your corrective commit.

The VM is stopped, the shared gates are released, and there are no owned test processes remaining. No merges to main.

Neil Colvin, with assistance from OpenAI Codex.

@oznetmaster oznetmaster left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@CharliePoole, I re-reviewed 13de812. Both Windows targets build cleanly, and all 32 TestAgentServiceTests pass on each. The separate ITestAgentService makes the aggregate/sub-provider distinction explicit; its eventual API-package exposure remains a separate follow-up.

Two isolated probes still prevent approval:

  1. Moving the throw into TestAgentService.OnAgentExit does not move it onto the runner's calling thread. A registered-agent exit-42 probe still terminates its .NET 10 caller with an unhandled NUnitEngineException, now through FireAgentExitedEvent -> TestAgentService.OnAgentExit. Record the failure and let the runner observe it through a safe notification or subsequent call; the process callback must not throw out to the thread pool.

  2. OnAgentExit removes ownership before ReturnAgent succeeds. With an acquired agent and a provider exit event, catching the event exception and then calling ReturnAgent rejects the reference as already released; the originating provider receives zero return calls. Keep the originating provider/reference until return succeeds, separately tracking exit or unavailability. The new removal also bypasses the dictionary lock used elsewhere.

GetAgentExitMessage now locks its lookup, but holds that lock while the provider can wait up to a second for the process. Please take the ownership snapshot under the lock, then perform the provider call outside it.

The probes use the exact unmodified PR production source; I have restored our private integration checkout afterward. No merge from me.

Neil Colvin, with assistance from OpenAI Codex.

Copy link
Copy Markdown
Collaborator

@CharliePoole, I have prepared a small correction on your exact #1964 head 13de812. It changes only TestAgentService.cs plus a six-case regression fixture. It is local, not pushed or merged.

The exit handler records the diagnostic without throwing out of the callback and retains the exact acquired reference/provider until ReturnAgent succeeds. ProcessRunner already calls GetAgentExitMessage when constructing a failed result, so the diagnostic uses that existing path. The lookup now releases the ownership-index lock before consulting the local provider. There are no API, launcher, dependency or provider-registration changes.

The six regression cases fail before and pass after on both Windows targets. They cover optional native exit codes, successful return after exit, failed-return retry, unrelated provider/reference events, and the real ProcessRunner failure-result path with both the exit diagnostic and underlying transport exception retained. A separate controlled ownership-removal mutation fails the retry test on each target, independently of the callback throw.

Complete required engine suites pass: net462 413 passed/19 existing skips; net10.0 405 passed/19 existing skips, zero failures. The isolated .NET 10 native Process.Exited probe also survives exit code 42, retains the diagnostic and successfully returns the acquired reference. Builds retain upstream C# 13, signing and analyzers, with zero warnings/errors.

This is an interim safety correction, not the fuller upstream notification design. It does not proactively wake a pending transport call or synthesize completion events; those remain follow-up work. Existing disabled or pending fixtures and their classifications are unchanged.

The patch can be applied to your branch or taken as a separate follow-up, according to how you would prefer to proceed. No merges until we agree.

Neil Colvin, with assistance from OpenAI Codex.

Complete proposed correction and regression tests (two-file patch against 13de812)
diff --git a/src/NUnitEngine/nunit.engine.tests/Services/TestAgentServiceExitNotificationTests.cs b/src/NUnitEngine/nunit.engine.tests/Services/TestAgentServiceExitNotificationTests.cs
new file mode 100644
index 00000000..40380765
--- /dev/null
+++ b/src/NUnitEngine/nunit.engine.tests/Services/TestAgentServiceExitNotificationTests.cs
@@ -0,0 +1,157 @@
+// Copyright (c) Charlie Poole, Rob Prouse and Contributors. MIT License - see LICENSE.txt
+
+using System;
+using System.IO;
+using NSubstitute;
+using NUnit.Common;
+using NUnit.Engine.Runners;
+using NUnit.Framework;
+
+namespace NUnit.Engine.Services
+{
+    /// <summary>
+    /// Checks that provider exit notifications preserve runner diagnostics and the
+    /// acquired reference's return path without throwing on the notifying thread.
+    /// </summary>
+    public class TestAgentServiceExitNotificationTests
+    {
+        private ServiceContext _services;
+        private TestAgentService _agency;
+        private ITestAgentProvider _provider;
+        private ITestAgent _agent;
+        private TestPackage _package;
+
+        [SetUp]
+        public void SetUp()
+        {
+            _agent = Substitute.For<ITestAgent>();
+            _agent.Id.Returns(Guid.NewGuid());
+            _provider = Substitute.For<ITestAgentProvider, IService>();
+            _provider.IsAgentAvailable(Arg.Any<TestPackage>()).Returns(true);
+            _provider.GetAgent(Arg.Any<TestPackage>()).Returns(_agent);
+            _services = new ServiceContext();
+            _services.Add((IService)_provider);
+            _agency = new TestAgentService();
+            _services.Add(_agency);
+            _services.ServiceManager.StartServices();
+            _package = new TestPackage("offline.dll").SubPackages[0];
+            _package.AddSetting(SettingDefinitions.TargetFrameworkName.WithValue(".NETCoreApp,Version=v10.0"), false);
+        }
+
+        [TearDown]
+        public void TearDown()
+        {
+            _agency.Dispose();
+            _services.ServiceManager.Dispose();
+        }
+
+        [TestCase(42)]
+        [TestCase(null)]
+        public void ExitNotificationRetainsDiagnosticAndReturnPath(int? exitCode)
+        {
+            _agency.GetAgent(_package);
+
+            Assert.That(() => NotifyExit(_provider, _agent, exitCode), Throws.Nothing);
+            Assert.That(_agency.IsAgentActive(_agent.Id), Is.True, "The acquired reference still needs to be returned.");
+            var message = _agency.GetAgentExitMessage(_agent.Id);
+            Assert.That(message, Does.Contain(_agent.Id.ToString("B")).And.Contain("Controlled agent exit"));
+            if (exitCode is not null)
+                Assert.That(message, Does.Contain($"Native process exit code: {exitCode}."));
+            else
+                Assert.That(message, Does.Not.Contain("Native process exit code"));
+
+            _agency.ReturnAgent(_agent);
+
+            _provider.Received(1).ReturnAgent(_agent);
+            Assert.That(_agency.IsAgentActive(_agent.Id), Is.False);
+        }
+
+        [Test]
+        public void ReturnFailureAfterExitRetainsOwnershipForRetry()
+        {
+            _agency.GetAgent(_package);
+            NotifyExit(_provider, _agent, null);
+            bool failReturn = true;
+            _provider.When(provider => provider.ReturnAgent(_agent)).Do(_ =>
+            {
+                if (failReturn)
+                    throw new IOException("Controlled return failure");
+            });
+
+            Assert.That(() => _agency.ReturnAgent(_agent), Throws.TypeOf<IOException>());
+            Assert.That(_agency.IsAgentActive(_agent.Id), Is.True);
+
+            failReturn = false;
+            _agency.ReturnAgent(_agent);
+
+            _provider.Received(2).ReturnAgent(_agent);
+            Assert.That(_agency.IsAgentActive(_agent.Id), Is.False);
+        }
+
+        [Test]
+        public void ProcessRunnerReportsRecordedExitWhenTransportFails()
+        {
+            var remoteRunner = Substitute.For<ITestEngineRunner>();
+            _agent.CreateRunner(_package).Returns(remoteRunner);
+            remoteRunner.Explore(TestFilter.Empty).Returns(_ =>
+            {
+                NotifyExit(_provider, _agent, 42);
+                throw new IOException("Controlled transport failure");
+            });
+            var runnerServices = Substitute.For<IServiceLocator>();
+            runnerServices.GetService<TestAgentService>().Returns(_agency);
+            runnerServices.GetService<ITestRunnerFactory>().Returns(Substitute.For<ITestRunnerFactory>());
+            using (var runner = new ProcessRunner(runnerServices, _package))
+            {
+                var result = runner.Explore(TestFilter.Empty);
+
+                Assert.That(result.Xml.GetAttribute("result"), Is.EqualTo("Failed"));
+                var message = result.Xml.SelectSingleNode("failure/message")!.InnerText;
+                Assert.That(message, Does.Contain("Controlled agent exit")
+                    .And.Contain("Native process exit code: 42.").And.Contain("Controlled transport failure"));
+                Assert.That(_agency.IsAgentActive(_agent.Id), Is.True);
+            }
+
+            _provider.Received(1).ReturnAgent(_agent);
+            Assert.That(_agency.IsAgentActive(_agent.Id), Is.False);
+        }
+
+        [TestCase(false)]
+        [TestCase(true)]
+        public void NotificationFromAnotherProviderOrReferenceDoesNotChangeOwnership(bool differentReference)
+        {
+            var otherProvider = Substitute.For<ITestAgentProvider, IService>();
+            var services = new ServiceContext();
+            services.Add((IService)_provider);
+            services.Add((IService)otherProvider);
+            var agency = new TestAgentService();
+            services.Add(agency);
+            services.ServiceManager.StartServices();
+            try
+            {
+                agency.GetAgent(_package);
+                var id = _agent.Id;
+                var notificationAgent = Substitute.For<ITestAgent>();
+                notificationAgent.Id.Returns(id);
+
+                Assert.That(() => NotifyExit(differentReference ? _provider : otherProvider,
+                    differentReference ? notificationAgent : _agent, 42), Throws.Nothing);
+
+                Assert.That(agency.GetAgentExitMessage(id), Is.Null);
+                Assert.That(agency.IsAgentActive(id), Is.True);
+                agency.ReturnAgent(_agent);
+                _provider.Received(1).ReturnAgent(_agent);
+            }
+            finally
+            {
+                services.ServiceManager.Dispose();
+            }
+        }
+
+        private static void NotifyExit(ITestAgentProvider provider, ITestAgent agent, int? exitCode)
+        {
+            provider.AgentExited += Raise.Event<AgentExitedEventHandler>(provider,
+                new AgentExitedEventArgs(agent, "Controlled agent exit", exitCode));
+        }
+    }
+}
diff --git a/src/NUnitEngine/nunit.engine/Services/TestAgentService.cs b/src/NUnitEngine/nunit.engine/Services/TestAgentService.cs
index 3a2d6b08..78dd1665 100644
--- a/src/NUnitEngine/nunit.engine/Services/TestAgentService.cs
+++ b/src/NUnitEngine/nunit.engine/Services/TestAgentService.cs
@@ -190,18 +190,26 @@ namespace NUnit.Engine.Services
 
         private void OnAgentExit(object sender, AgentExitedEventArgs e)
         {
-            _agentOwners.Remove(e.Agent.Id);
-
-            // TODO: Currently, ProcessRunner and other upstream callers expect
-            // to receive an exception when an agent exits unexpectedly. A more
-            // robust mechanism is needed to handle this situation, such as a
-            // callback or event to notify the caller.
             var sb = new StringBuilder($"Agent {e.Agent.Id:B} exited unexpectedly.");
             if (e.ExitCode is not null)
                 sb.Append($" Native process exit code: {e.ExitCode}.");
             if (!string.IsNullOrEmpty(e.Message))
                 sb.AppendLine($"{e.Message}");
-            throw new NUnitEngineException(sb.ToString());
+            string message = sb.ToString();
+
+            lock (_agentOwners)
+            {
+                if (!_agentOwners.TryGetValue(e.Agent.Id, out var ownership)
+                    || !ReferenceEquals(ownership.Provider, sender)
+                    || !ReferenceEquals(ownership.Agent, e.Agent))
+                    return;
+
+                // This may run on a process-exit callback thread. Retain the
+                // diagnostic for the runner and ownership until return succeeds.
+                ownership.ExitMessage = message;
+            }
+
+            log.Error(message);
         }
 
         #endregion
@@ -221,18 +229,25 @@ namespace NUnit.Engine.Services
             internal ITestAgent Agent { get; }
             internal ITestAgentProvider Provider { get; }
             internal bool Released { get; set; }
+            internal string? ExitMessage { get; set; }
         }
 
         internal string? GetAgentExitMessage(Guid agentId)
         {
+            AgentOwnership ownership;
             lock (_agentOwners)
             {
-                if (_agentOwners.TryGetValue(agentId, out var ownership))
-                    if (ownership.Provider is LocalProcessAgentProvider localProvider)
-                        return localProvider.GetAgentExitMessage(agentId);
+                if (!_agentOwners.TryGetValue(agentId, out ownership!))
+                    return null;
+
+                if (ownership.ExitMessage is not null)
+                    return ownership.ExitMessage;
             }
 
-            return null;
+            // The local diagnostic can wait for native exit; do not hold the
+            // ownership index lock while calling the provider.
+            return ownership.Provider is LocalProcessAgentProvider localProvider
+                ? localProvider.GetAgentExitMessage(agentId) : null;
         }
     }
 }

Copy link
Copy Markdown
Collaborator

@CharliePoole, an updated Windows validation result: the full Package target now succeeds on our private combined candidate based on your #1964 head 13de8129.

The three earlier modern Console mismatches corresponded to missing .NET 7 x64/x86 and .NET 6 x86 runtimes on this workstation. I installed Microsoft's .NET 7.0.20 x64/x86 and .NET 6.0.36 x86 runtimes and verified their visibility from both hosts. No restart was required.

The first rerun then caught seven prototype copyright headers in the combined session files. A separate comments-only local commit adds the repository's required header while retaining the original notices. With that correction, header checking, solution build, package installation/content/dependency verification, and 52/52 Framework Console plus 52/52 modern Console package cases pass. No checks or test expectations were bypassed or changed. The earlier failed reports remain preserved.

For context, the preceding checks on this combined candidate also passed:

  • Required engine suites: 601 passed, zero failed, eight existing skips on each Windows target.
  • Session/deployment suite: 77/77, including both Console frontends with real .NET 8/9/10 workers, cancellation and cleanup controls.
  • Workflow-adapter suite: 27/27, including real VSTest/dotnet-test execution, plus two stock NUnit3TestAdapter local/coexistence controls using its unchanged bundled engine.

Those engine/session/adapter results were obtained before the runtime installation; the fresh rerun reported here is the complete package target. All results in this comment are Windows-only.

The private candidate includes the proposed exit correction and additional remote/session integration work, including a separately isolated return-lock correction. The original two-file exit proposal remains separate. Your coordinator interface, service lookup and 32 coordinator tests are retained. The published #1964 source is unchanged; these results apply to the private combined candidate.

No branch changes were pushed and no merges were performed. We will wait for agreement before merging.

Neil Colvin, with assistance from OpenAI Codex.

@oznetmaster oznetmaster left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@CharliePoole, re-reviewed 7758c92. This incorporates the proposed exit correction and six regressions, resolving my requested changes: the callback records the diagnostic without throwing, ownership remains until return succeeds, and the provider diagnostic call runs outside the ownership-index lock.

I built and tested the exact unmodified PR head on both Windows targets, with zero build warnings/errors. The required suites pass: net462 413 passed/19 existing skips; net10.0 405 passed/19 existing skips; zero failures. Both the 32 coordinator cases and six exit-notification cases pass on each target. The isolated native Process.Exited probe also survives exit code 42, preserves the diagnostic, and successfully returns the acquired agent. CI is green on this head.

The fuller upstream exit-notification work and separately isolated return-callback locking improvement remain follow-ups. These results concern this PR's source, independently of our larger private remote/session candidate.

Approving this structural slice. No merge from me pending our agreement.

Neil Colvin, with assistance from OpenAI Codex.

@CharliePoole
CharliePoole merged commit 936ca1b into main Nov 15, 2026
2 checks passed
@CharliePoole
CharliePoole deleted the issue-1726 branch November 15, 2026 17:14
@CharliePoole
CharliePoole restored the issue-1726 branch November 15, 2026 17:14
@CharliePoole
CharliePoole deleted the issue-1726 branch November 15, 2026 17:14
oznetmaster added a commit to oznetmaster/nunit-console that referenced this pull request Nov 15, 2026
Restore ownership, exit and local-release fixtures against Charlie's nunit#1964 structure. Keep coordinator return ownership separate from local process liveness, restore test-helper entry points and retain child-process isolation for fatal callbacks.

Production code and the existing provider-server Ignore remain unchanged. The known nonzero-exit callback failures are recorded separately; all focused cases pass with the isolated callback control correction.

Co-authored-by: OpenAI Codex <codex@openai.com>
@oznetmaster
oznetmaster restored the issue-1726 branch November 15, 2026 17:40
oznetmaster added a commit to oznetmaster/nunit-console that referenced this pull request Nov 15, 2026
Restore ownership, exit and local-release fixtures against Charlie's nunit#1964 structure. Keep coordinator return ownership separate from local process liveness, restore test-helper entry points and retain child-process isolation for fatal callbacks.

Production code and the existing provider-server Ignore remain unchanged. The known nonzero-exit callback failures are recorded separately; all focused cases pass with the isolated callback control correction.

Co-authored-by: OpenAI Codex <codex@openai.com>
@oznetmaster
oznetmaster deleted the issue-1726 branch November 15, 2026 17:41
oznetmaster added a commit to oznetmaster/nunit-console that referenced this pull request Nov 15, 2026
Restore ownership, exit and local-release fixtures against Charlie's nunit#1964 structure. Keep coordinator return ownership separate from local process liveness, restore test-helper entry points and retain child-process isolation for fatal callbacks.

Production code and the existing provider-server Ignore remain unchanged. The known nonzero-exit callback failures are recorded separately; all focused cases pass with the isolated callback control correction.

Co-authored-by: OpenAI Codex <codex@openai.com>
oznetmaster added a commit to oznetmaster/nunit-console that referenced this pull request Nov 15, 2026
Retain the five API and service-registry regressions from nunit#1963 on current main,
which already implements service enumeration and pins API beta.101.4 after nunit#1964.
No production source or dependency change is needed.

Co-authored-by: OpenAI Codex <codex@openai.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants