test: migrate AdminUI/ControlPlane/Runtime/Host tests to xunit.v3 (#756)
v2-ci / unit-tests (push) Failing after 13m22s

Akka.TestKit.Xunit2 -> Akka.TestKit.Xunit 1.5.62 (xunit.v3 TestKit; needs xunit.v3 3.2.2, set via
VersionOverride on the four projects). Removes the xunit 2.9.3 pin. IAsyncLifetime returns ValueTask,
SqlServerFactAttribute gains the source-info ctor, and xUnit1051 call sites pass
TestContext.Current.CancellationToken. Test counts unchanged.

Claude-Session: https://claude.ai/code/session_01GT67AEHd2Acv1YPwGfXEoV
This commit is contained in:
Joseph Doherty
2026-11-10 08:57:33 -05:00
parent 2a8e2981fe
commit b211911f98
191 changed files with 2161 additions and 2166 deletions
@@ -34,7 +34,7 @@ public sealed class DriverInstanceActorWriteAndSubscribeTests : RuntimeActorTest
var reply = await actor.Ask<DriverInstanceActor.WriteAttributeResult>(
new DriverInstanceActor.WriteAttribute("tag-1", 42),
TimeSpan.FromSeconds(2));
TimeSpan.FromSeconds(2), TestContext.Current.CancellationToken);
// Stubbed drivers deterministically succeed writes without touching hardware (existing behaviour).
reply.Success.ShouldBeTrue();
@@ -53,12 +53,12 @@ public sealed class DriverInstanceActorWriteAndSubscribeTests : RuntimeActorTest
var actor = Sys.ActorOf(DriverInstanceActor.Props(driver));
actor.Tell(new DriverInstanceActor.InitializeRequested("{}"));
AwaitCondition(() => driver.InitializeStarted, TimeSpan.FromSeconds(2));
AwaitCondition(() => driver.InitializeStarted, TimeSpan.FromSeconds(2), TestContext.Current.CancellationToken);
var sw = System.Diagnostics.Stopwatch.StartNew();
var reply = await actor.Ask<DriverInstanceActor.WriteAttributeResult>(
new DriverInstanceActor.WriteAttribute("tag-1", 42),
TimeSpan.FromSeconds(2));
TimeSpan.FromSeconds(2), TestContext.Current.CancellationToken);
sw.Stop();
reply.Success.ShouldBeFalse();
@@ -80,11 +80,11 @@ public sealed class DriverInstanceActorWriteAndSubscribeTests : RuntimeActorTest
actor.Tell(new DriverInstanceActor.InitializeRequested("{}"));
// The first Initialize attempt throws and pushes the actor into Reconnecting.
AwaitCondition(() => driver.InitializeCount >= 1, TimeSpan.FromSeconds(2));
AwaitCondition(() => driver.InitializeCount >= 1, TimeSpan.FromSeconds(2), TestContext.Current.CancellationToken);
var reply = await actor.Ask<DriverInstanceActor.WriteAttributeResult>(
new DriverInstanceActor.WriteAttribute("tag-1", 42),
TimeSpan.FromSeconds(2));
TimeSpan.FromSeconds(2), TestContext.Current.CancellationToken);
reply.Success.ShouldBeFalse();
reply.Reason.ShouldNotBeNull();
@@ -114,11 +114,11 @@ public sealed class DriverInstanceActorWriteAndSubscribeTests : RuntimeActorTest
actor.Tell(new DriverInstanceActor.SetDesiredSubscriptions(
new[] { "tag-a", "tag-b" }, TimeSpan.FromMilliseconds(100)));
actor.Tell(new DriverInstanceActor.InitializeRequested("{}"));
AwaitCondition(() => driver.SubscribeCount >= 1, TimeSpan.FromSeconds(2));
AwaitCondition(() => driver.SubscribeCount >= 1, TimeSpan.FromSeconds(2), TestContext.Current.CancellationToken);
// Force a reconnect to exercise the resubscribe path a second time.
actor.Tell(new DriverInstanceActor.DisconnectObserved("backend blip"));
AwaitCondition(() => driver.SubscribeCount >= 2, TimeSpan.FromSeconds(3));
AwaitCondition(() => driver.SubscribeCount >= 2, TimeSpan.FromSeconds(3), TestContext.Current.CancellationToken);
// BARRIER: the self-resubscribe reply is published asynchronously, so SubscribeCount>=2 alone
// doesn't guarantee the actor has yet PROCESSED the self-sent SubscriptionEstablished (the point
@@ -129,9 +129,9 @@ public sealed class DriverInstanceActorWriteAndSubscribeTests : RuntimeActorTest
// race-free.
await actor.Ask<DriverInstanceActor.SubscriptionEstablished>(
new DriverInstanceActor.Subscribe(new[] { "tag-a", "tag-b" }, TimeSpan.FromMilliseconds(100)),
TimeSpan.FromSeconds(3));
TimeSpan.FromSeconds(3), TestContext.Current.CancellationToken);
deadLetters.ExpectNoMsg(TimeSpan.FromMilliseconds(500));
deadLetters.ExpectNoMsg(TimeSpan.FromMilliseconds(500), TestContext.Current.CancellationToken);
}
/// <summary>
@@ -157,7 +157,7 @@ public sealed class DriverInstanceActorWriteAndSubscribeTests : RuntimeActorTest
var actor = Sys.ActorOf(DriverInstanceActor.Props(driver, reconnectInterval: TimeSpan.FromSeconds(30)));
actor.Tell(new DriverInstanceActor.InitializeRequested("{}"));
// Wait until Connected (subscribe path available).
AwaitCondition(() => driver.InitializeCount >= 1, TimeSpan.FromSeconds(2));
AwaitCondition(() => driver.InitializeCount >= 1, TimeSpan.FromSeconds(2), TestContext.Current.CancellationToken);
// Tell SubscriptionFailed directly — a faithful stand-in for the self-reply landing on the
// actor on the self-resubscribe path. This exercises exactly the Receive<SubscriptionFailed>
@@ -168,9 +168,9 @@ public sealed class DriverInstanceActorWriteAndSubscribeTests : RuntimeActorTest
// Subscribe Ask (which the Connected state can answer) as the barrier.
await actor.Ask<DriverInstanceActor.SubscriptionEstablished>(
new DriverInstanceActor.Subscribe(new[] { "barrier-ref" }, TimeSpan.FromMilliseconds(100)),
TimeSpan.FromSeconds(3));
TimeSpan.FromSeconds(3), TestContext.Current.CancellationToken);
deadLetterProbe.ExpectNoMsg(TimeSpan.FromMilliseconds(500));
deadLetterProbe.ExpectNoMsg(TimeSpan.FromMilliseconds(500), TestContext.Current.CancellationToken);
}
/// <summary>