From 83778b19e113fc42b027c345499fd4e194ae6c82 Mon Sep 17 00:00:00 2001 From: routersys Date: Fri, 2 Oct 2026 13:17:23 +0900 Subject: [PATCH] =?UTF-8?q?=E5=9B=BA=E5=AE=9A=E3=81=AE=E7=90=86=E7=94=B1?= =?UTF-8?q?=E3=81=8C=E3=81=BB=E3=81=8B=E3=81=AE=E7=90=86=E7=94=B1=E3=82=88?= =?UTF-8?q?=E3=82=8A=E5=85=88=E3=81=AB=E6=B1=BA=E3=81=BE=E3=82=8B=E8=A9=A6?= =?UTF-8?q?=E9=A8=93=E3=82=92=E8=BF=BD=E5=8A=A0=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ComputeGuardianSelectionTests.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/ComputeGuard.Tests/ComputeGuardianSelectionTests.cs b/ComputeGuard.Tests/ComputeGuardianSelectionTests.cs index 2b21121..7cd207f 100644 --- a/ComputeGuard.Tests/ComputeGuardianSelectionTests.cs +++ b/ComputeGuard.Tests/ComputeGuardianSelectionTests.cs @@ -185,6 +185,22 @@ public sealed class ComputeGuardianSelectionTests Assert.Same(cause, report.InnerException); } + [Fact] + public void ThePinComesBeforeEveryOtherReason() + { + var (guardian, _) = CreateGuardian(); + var software = Device(1L, isSoftware: true); + var small = Device(2L, capacity: 1000L); + guardian.Fail(software, Workload, ComputeFailure.DeviceLost, null); + guardian.Fail(small, Workload, ComputeFailure.DeviceLost, null); + + var softwareDecision = guardian.Select(software, Workload, PassingSelfTest); + var smallDecision = guardian.Select(small, Workload, PassingSelfTest); + + Assert.Equal(new ComputeDecision(ComputeRoute.Cpu, ComputeRouteReason.Pinned), softwareDecision); + Assert.Equal(new ComputeDecision(ComputeRoute.Cpu, ComputeRouteReason.Pinned), smallDecision); + } + [Fact] public void ConcurrentSelectionsRunTheSelfTestOnce() {