@mark1russell7/harness 0.16.33 → 0.16.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -61,6 +61,20 @@ A pull request that changes the VM tier starts `vm.yml` (SYS-155). The workflow
61
61
 
62
62
  A void run does not pass. The arm writes its boot record (`<arm>.boot.json`) before the cells, thus a guest that did not boot fails the control case. A runner with no `/dev/kvm` fails the job in a pull request or a push. Only a dispatch keeps the void result of rule 8. `VM_TIER_FAULTS` names the faults of the gate, and the rig `systems.vm` of `docs/rigs.json` names the same faults.
63
63
 
64
+ ### The k3s rung
65
+
66
+ The file `src/k3s.ts` and the workflow `k3s.yml` operate two guests of QEMU on the pinned kernel (SYS-85). One guest is a k3s server, and the other is a k3s agent. Each guest has its own kernel and its own overlay of the disk. A link of QEMU joins their second NICs on a TCP port of the runner, with no root. The file `vm/k3s.json` pins the k3s binary and its SHA-256, on the Kubernetes minor of the newest node image of kind.
67
+
68
+ The fault is a power-off of the agent: SIGKILL to its QEMU process. The kernel of the agent stops with its pods. A frozen container in kind keeps its kernel, thus this rung tests the claim that a frozen container stands for a lost node. After each loss, the agent boots again on the same disk. The record `k3s.json` (format `harness-k3s/1`) keeps the time of each step. `k3sArmProblems` in `src/k3s-tier.ts` compares it with the cases of the self-test:
69
+
70
+ | Case | The result that the case expects |
71
+ | --- | --- |
72
+ | control | Each guest operates the kernel of `vm/linux.json`, and its boot to ssh takes 30 s or less. The two nodes are Ready in 300 s or less. A hold of 70 s gives no change of the Ready condition. |
73
+ | loss | Four or more of five power-offs are counted. The Ready condition of the agent goes to `Unknown` from 39.6 s to 56.0 s after the power-off. |
74
+ | return | After the agent boots again, its pod has a new sandbox or a higher restart count. |
75
+
76
+ A run that starts before the agent is Ready with no taint of the controller is void. A void arm does not pass. `K3S_TIER_FAULTS` names the fault of the gate, and the rig `systems.k3s` of `docs/rigs.json` names the same fault.
77
+
64
78
  ## The topologies
65
79
 
66
80
  A topology (`Topology`) is the chain of hops from the client to the target, as data. Each hop is on two networks, one for each side. Network j joins element j and element j + 1: the client is element 0, and the target is the last element.
package/build/index.d.ts CHANGED
@@ -2873,6 +2873,123 @@ type VmCase = VmControlCase | VmFaultCase;
2873
2873
  * with no boot record, no record of the cell or no counted run gives a problem: a void arm does not pass.
2874
2874
  */
2875
2875
  export declare const vmArmProblems: (arm: VmArm, cases: readonly VmCase[]) => string[];
2876
+ /** The pin of the k3s binary: its release and the SHA-256 of the file `k3s` of that release. */
2877
+ interface K3sPin {
2878
+ readonly version: string;
2879
+ readonly sha256: string;
2880
+ }
2881
+ /** The first boot of one guest: the time from the start of QEMU to the first reply of ssh, and the kernel. */
2882
+ interface K3sBoot {
2883
+ readonly node: string;
2884
+ readonly ms: number;
2885
+ /** This text is the release of the kernel of the guest, as `uname -r` gives it. */
2886
+ readonly kernel: string;
2887
+ }
2888
+ /** The pod of the workload on the agent, as the API server and the runtime of the agent give it. */
2889
+ interface K3sPod {
2890
+ readonly uid: string;
2891
+ readonly restarts: number;
2892
+ /** This text is the ID of the container, from the status of the pod. */
2893
+ readonly container: string;
2894
+ /** This text is the ID of the ready sandbox of the pod, from `crictl` on the agent. */
2895
+ readonly sandbox: string;
2896
+ }
2897
+ /** The hold of the control: the two nodes stay Ready, with no fault. */
2898
+ interface K3sHold {
2899
+ readonly ms: number;
2900
+ readonly polls: number;
2901
+ /** This number is the count of the polls where a node was not Ready, or the Ready condition had a new transition time. */
2902
+ readonly changes: number;
2903
+ }
2904
+ /** One power-off of the agent. Each time is a time of the runner, in ms since the epoch. */
2905
+ interface K3sPowerOff {
2906
+ readonly index: number;
2907
+ /** This text tells why the run is void, or it is null for a counted run. A void run has no power-off. */
2908
+ readonly void: string | null;
2909
+ /** This number is the time of the SIGKILL to the QEMU of the agent. */
2910
+ readonly killedAt: number | null;
2911
+ /** This number is the start of the last poll that read the Ready condition `True`. */
2912
+ readonly lastReadyAt: number | null;
2913
+ /** This number is the end of the first poll that read the Ready condition `Unknown`, or null when no poll read it. */
2914
+ readonly unknownAt: number | null;
2915
+ /** This text is the `lastTransitionTime` of the Ready condition at that poll, from the clock of the server. */
2916
+ readonly transition: string | null;
2917
+ /** This number is the time of the boot of the agent after the power-off, to the first reply of ssh. */
2918
+ readonly bootMs: number | null;
2919
+ /** This number is the end of the first poll after that boot that read the Ready condition `True`. */
2920
+ readonly readyAt: number | null;
2921
+ readonly before: K3sPod | null;
2922
+ /** This value is the pod after the return, or the last value that a poll read when the time limit passed. */
2923
+ readonly after: K3sPod | null;
2924
+ }
2925
+ /** The record of one arm of the k3s rung. The command `arm` writes it after each step, thus a failed arm keeps its steps. */
2926
+ interface K3sRecord {
2927
+ readonly format: "harness-k3s/1";
2928
+ /** This text is the release of k3s, from `vm/k3s.json`. */
2929
+ readonly k3s: string;
2930
+ /** This text is the version of the API server, or null before the server answers. */
2931
+ readonly kubernetes: string | null;
2932
+ readonly boots: readonly K3sBoot[];
2933
+ /** This number is the time from the start of the server to the Ready condition `True` on the two nodes. */
2934
+ readonly readyMs: number | null;
2935
+ readonly hold: K3sHold | null;
2936
+ readonly runs: readonly K3sPowerOff[];
2937
+ /** This text is the error that stopped the arm, or null. */
2938
+ readonly error: string | null;
2939
+ }
2940
+ /**
2941
+ * The gate of the k3s rung of layer E4 (`k3s.ts`, SYS-85). The workflow `k3s.yml` boots two guests of QEMU, a k3s
2942
+ * server and a k3s agent, and it powers off the agent. A power-off stops the kernel of the agent, as in the loss of a
2943
+ * real node. A frozen container in kind keeps its kernel.
2944
+ *
2945
+ * This file reads the record of that arm, and gives each difference from the cases of the self-test as data. The
2946
+ * control case examines the boots, the join and a hold with no fault. The loss case and the return case examine
2947
+ * each power-off.
2948
+ */
2949
+ /** The kinds of fault that the k3s rung applies. */
2950
+ type K3sFaultKind = "node-loss";
2951
+ /** The kinds of fault that the gate of the k3s rung examines. */
2952
+ export declare const K3S_TIER_FAULTS: readonly K3sFaultKind[];
2953
+ /** The control case: two guests on the pinned kernel boot in their time, join, and stay Ready with no fault. */
2954
+ interface K3sControlCase {
2955
+ readonly kind: "control";
2956
+ readonly name: string;
2957
+ /** This text is the release of the pinned kernel, the version of `vm/linux.json`. */
2958
+ readonly kernel: string;
2959
+ /** This text is the pinned release of k3s, the version of `vm/k3s.json`. */
2960
+ readonly k3s: string;
2961
+ /** The first boot of each guest to ssh must take this time in ms or less. */
2962
+ readonly bootMaxMs: number;
2963
+ /** The two nodes must be Ready in this time in ms or less, from the start of the server. */
2964
+ readonly readyMaxMs: number;
2965
+ /** The hold must last this time in ms or more, with no change of the Ready condition of a node. */
2966
+ readonly holdMinMs: number;
2967
+ }
2968
+ /** The loss case: the server sets the Ready condition of the lost agent to `Unknown` in a range of time. */
2969
+ interface K3sLossCase {
2970
+ readonly kind: "loss";
2971
+ readonly name: string;
2972
+ readonly fault: K3sFaultKind;
2973
+ /** The count of the runs that are not void must be this count or more. */
2974
+ readonly runsMin: number;
2975
+ /** The time in s from the power-off to the first poll that reads `Unknown` must be in this range, for each counted run. */
2976
+ readonly unknown: readonly [number, number];
2977
+ }
2978
+ /** The return case: after the agent boots again, the pod of the workload has a new sandbox or a higher restart count. */
2979
+ interface K3sReturnCase {
2980
+ readonly kind: "return";
2981
+ readonly name: string;
2982
+ readonly fault: K3sFaultKind;
2983
+ /** The count of the runs that are not void must be this count or more. */
2984
+ readonly runsMin: number;
2985
+ }
2986
+ /** One case of the self-test of the k3s rung. */
2987
+ type K3sCase = K3sControlCase | K3sLossCase | K3sReturnCase;
2988
+ /**
2989
+ * This function gives each difference between the record of an arm of the k3s rung and the result that a case
2990
+ * expects. No record, a record of another format or no counted run gives a problem: a void arm does not pass.
2991
+ */
2992
+ export declare const k3sArmProblems: (record: K3sRecord | null, cases: readonly K3sCase[]) => string[];
2876
2993
  /**
2877
2994
  * This module reads the lockfiles of a build context for the manifest of a run. A lockfile pins each
2878
2995
  * package that a build installs, thus its sha256 pins the packages that the image holds. The
@@ -3461,4 +3578,4 @@ export declare const environmentCounts: (cell: Cell, runs: number) => number[];
3461
3578
  * Each environment does a warm-up first, and the result keeps it apart from the counted runs.
3462
3579
  */
3463
3580
  export declare const runCell: (cell: Cell, say?: (line: string) => void) => Promise<CellResult>;
3464
- export { type Agent, type BuildImage, type BuildRecord, CLIENT_CAPABILITIES, type CallReading, type Cell, type CellResult, type Client, type ClientCapability, type ClientImage, type ClockPair, type Cloud, type Cluster, type ClusterClientAt, type ClusterLab, type ClusterStage, type ConntrackPrediction, type ConntrackReading, type ContainerLimits, type ContextFile, type CountBand, type CpuLists, type CpuShares, type CpuState, type CpuStates, type Crossings, type Cut, type Decision, type DeliveryPrediction, type DeliveryReading, type DeliveryStream, type DiskImage, type DiskLab, type DiskLabOptions, type DiskLayerRecord, type DiskPinnable, type DiskRecord, type DiskSubject, type DiskTornRecord, type DiskWriterRecord, type Drill, type DrillRoom, type DriverBand, type DriverSocket, type DriverStep, type DriverStepTime, type EgressBurst, type EgressPacketLaw, type EgressPacketReading, type EgressPrediction, type EgressReading, type ErrorOnTheWay, type EstimateVerdict, type Fabric, type FabricArrival, type FabricControl, type FabricFault, type FabricFaultKind, type FabricGap, type FabricImage, type FabricLab, type FabricLabOptions, type FabricLeafRecord, type FabricManifest, type FabricParts, type FabricPinnable, type FabricRecord, type FabricRouteRecord, type FabricStamp, type FabricStreamRecord, type FabricTierLab, type Fault, type FaultOptions, type FaultPlace, type FaultSide, type Group, type GroupClient, type GroupLab, type GroupMeasured, type GroupNetworkFault, type GroupPlace, type GroupPrediction, type GroupReading, type GroupRole, type GroupVerdict, type GroupView, type Hop, type HopEvent, type HopPlace, type HopSignal, type HopWrite, type Host, type HostLimits, type HostSetting, type HostSysctl, type HttpProbe, type ImagePlan, type ImageSource, type Interval, type Jitter, type Kafka, type KafkaLab, type KafkaMember, type KafkaPause, type KernelRecord, LAYERS, LAYER_FACTS, LAYER_RIG_ENV, LIMITS, type Lab, type Layer, type LayerFacts, type LayerState, type LeafSessions, type LeafViews, type Limit, type LineCount, type LineMatch, type LoadBand, type LoadConnections, type LoadJudgement, type LoadPlan, type LoadPrediction, type LoadSpread, type LoadStream, type LoadVerdict, type Manifest, type ManifestHop, type Measured, type MemberLine, type MemoryLimits, type MemoryOomPrediction, type MemoryOomTask, type MemoryPrediction, type MemoryReading, type MemoryStep, type MemoryStepReading, type MemoryTaskReading, type MemoryThrottlePrediction, type MiddleboxEvent, type MiddleboxExpectation, type MiddleboxForm, type NetworkFault, type NodeLine, type Observer, type OplogRead, type OplogTime, type Outcome, type Outcomes, type Pair, type PairSets, type Pairing, type PartitionView, type PauseBand, type PauseCommit, type PausePrediction, type PauseReading, type Pinnable, type PinnedImage, type PortsPrediction, type PortsReading, type Prediction, type Probe, type ProbeEvent, type ProgramEvent, type ProxyHop, type ProxyTime, type QueueBand, type QueueConnection, type QueueConnectionReading, type QueueEnd, type QueuePrediction, type QueueReading, RESOURCES_EVENT, RESOURCES_PROGRAM, RIG_TERMS, type ReconnectReading, type ReconnectVerdict, type Reconnects, type RecordCode, type Recovers, type RecoveryMeasured, type Reference, type Reordering, type ReplicaSet, type ReplicaSetLab, type ReplicaSetStage, type Replies, type RequestPrediction, type RequestReading, type ResourceChange, type ResourceCpu, type ResourceDevice, type ResourceLimits, type ResourceMemory, type ResourceNetwork, type ResourceOptions, type ResourceReader, type ResourceReading, type ResourceTraffic, type RigTerm, type RigTermCell, type RouteLine, type RouterHop, type RttRange, type Run, type RunBackup, type RunCpus, type RunDrill, type RunEstimate, type RunFabric, type RunGroup, type RunLoad, type RunPart, type RunPause, type RunResources, type RunRoute, type RunStream, type RunTopology, type SentinelEvent, type SentinelStage, type Shipped, type ShippedImage, type Sibling, type SilenceDrops, type SocketPlace, type Spine, type Spread, type StackChange, type Stage, type StageBand, type StageVerdict, type StallReading, type Stamp, type Status, type StatusRow, type Subject, type Substrate, type SubstrateSource, TOXIC_RIG_TERMS, type Target, type TimeFromFault, type Topology, type Toxic, type Verdict, type VmArm, type VmBoot, type VmCase, type VmCellRecord, type VmControlCase, type VmFaultCase, type VmFaultKind, type WallStamp, type Writes, type WsProbe, cgroupKeyed, cgroupLimit, cgroupNumber, cpuMaxOf, cpuStatOf, cpusOfList, environmentProblems, hostLimitsOf, isHopPlace, latestEndOf, layerOf, limitsOf, limitsProblems, memoryStatOf, networkOf, resourceArgs, resourceChange, resourceReadingIn, resourceReadingOf, rigTermsOf };
3581
+ export { type Agent, type BuildImage, type BuildRecord, CLIENT_CAPABILITIES, type CallReading, type Cell, type CellResult, type Client, type ClientCapability, type ClientImage, type ClockPair, type Cloud, type Cluster, type ClusterClientAt, type ClusterLab, type ClusterStage, type ConntrackPrediction, type ConntrackReading, type ContainerLimits, type ContextFile, type CountBand, type CpuLists, type CpuShares, type CpuState, type CpuStates, type Crossings, type Cut, type Decision, type DeliveryPrediction, type DeliveryReading, type DeliveryStream, type DiskImage, type DiskLab, type DiskLabOptions, type DiskLayerRecord, type DiskPinnable, type DiskRecord, type DiskSubject, type DiskTornRecord, type DiskWriterRecord, type Drill, type DrillRoom, type DriverBand, type DriverSocket, type DriverStep, type DriverStepTime, type EgressBurst, type EgressPacketLaw, type EgressPacketReading, type EgressPrediction, type EgressReading, type ErrorOnTheWay, type EstimateVerdict, type Fabric, type FabricArrival, type FabricControl, type FabricFault, type FabricFaultKind, type FabricGap, type FabricImage, type FabricLab, type FabricLabOptions, type FabricLeafRecord, type FabricManifest, type FabricParts, type FabricPinnable, type FabricRecord, type FabricRouteRecord, type FabricStamp, type FabricStreamRecord, type FabricTierLab, type Fault, type FaultOptions, type FaultPlace, type FaultSide, type Group, type GroupClient, type GroupLab, type GroupMeasured, type GroupNetworkFault, type GroupPlace, type GroupPrediction, type GroupReading, type GroupRole, type GroupVerdict, type GroupView, type Hop, type HopEvent, type HopPlace, type HopSignal, type HopWrite, type Host, type HostLimits, type HostSetting, type HostSysctl, type HttpProbe, type ImagePlan, type ImageSource, type Interval, type Jitter, type K3sBoot, type K3sCase, type K3sControlCase, type K3sFaultKind, type K3sHold, type K3sLossCase, type K3sPin, type K3sPod, type K3sPowerOff, type K3sRecord, type K3sReturnCase, type Kafka, type KafkaLab, type KafkaMember, type KafkaPause, type KernelRecord, LAYERS, LAYER_FACTS, LAYER_RIG_ENV, LIMITS, type Lab, type Layer, type LayerFacts, type LayerState, type LeafSessions, type LeafViews, type Limit, type LineCount, type LineMatch, type LoadBand, type LoadConnections, type LoadJudgement, type LoadPlan, type LoadPrediction, type LoadSpread, type LoadStream, type LoadVerdict, type Manifest, type ManifestHop, type Measured, type MemberLine, type MemoryLimits, type MemoryOomPrediction, type MemoryOomTask, type MemoryPrediction, type MemoryReading, type MemoryStep, type MemoryStepReading, type MemoryTaskReading, type MemoryThrottlePrediction, type MiddleboxEvent, type MiddleboxExpectation, type MiddleboxForm, type NetworkFault, type NodeLine, type Observer, type OplogRead, type OplogTime, type Outcome, type Outcomes, type Pair, type PairSets, type Pairing, type PartitionView, type PauseBand, type PauseCommit, type PausePrediction, type PauseReading, type Pinnable, type PinnedImage, type PortsPrediction, type PortsReading, type Prediction, type Probe, type ProbeEvent, type ProgramEvent, type ProxyHop, type ProxyTime, type QueueBand, type QueueConnection, type QueueConnectionReading, type QueueEnd, type QueuePrediction, type QueueReading, RESOURCES_EVENT, RESOURCES_PROGRAM, RIG_TERMS, type ReconnectReading, type ReconnectVerdict, type Reconnects, type RecordCode, type Recovers, type RecoveryMeasured, type Reference, type Reordering, type ReplicaSet, type ReplicaSetLab, type ReplicaSetStage, type Replies, type RequestPrediction, type RequestReading, type ResourceChange, type ResourceCpu, type ResourceDevice, type ResourceLimits, type ResourceMemory, type ResourceNetwork, type ResourceOptions, type ResourceReader, type ResourceReading, type ResourceTraffic, type RigTerm, type RigTermCell, type RouteLine, type RouterHop, type RttRange, type Run, type RunBackup, type RunCpus, type RunDrill, type RunEstimate, type RunFabric, type RunGroup, type RunLoad, type RunPart, type RunPause, type RunResources, type RunRoute, type RunStream, type RunTopology, type SentinelEvent, type SentinelStage, type Shipped, type ShippedImage, type Sibling, type SilenceDrops, type SocketPlace, type Spine, type Spread, type StackChange, type Stage, type StageBand, type StageVerdict, type StallReading, type Stamp, type Status, type StatusRow, type Subject, type Substrate, type SubstrateSource, TOXIC_RIG_TERMS, type Target, type TimeFromFault, type Topology, type Toxic, type Verdict, type VmArm, type VmBoot, type VmCase, type VmCellRecord, type VmControlCase, type VmFaultCase, type VmFaultKind, type WallStamp, type Writes, type WsProbe, cgroupKeyed, cgroupLimit, cgroupNumber, cpuMaxOf, cpuStatOf, cpusOfList, environmentProblems, hostLimitsOf, isHopPlace, latestEndOf, layerOf, limitsOf, limitsProblems, memoryStatOf, networkOf, resourceArgs, resourceChange, resourceReadingIn, resourceReadingOf, rigTermsOf };
package/build/index.js CHANGED
@@ -6034,8 +6034,8 @@ const BOOT_FORMAT = "harness-vm-boot/1";
6034
6034
  const CELL_RECORD_FORMAT = "loom.cell-record/1";
6035
6035
  const wordsOf = (outcome) => outcome.kind === "error" ? `the error ${outcome.errno}` : outcome.kind;
6036
6036
  const range = ([low, high]) => `${low} s to ${high} s`;
6037
- const inRange = (value, [low, high]) => value >= low && value <= high;
6038
- const controlProblems = (arm, expected) => {
6037
+ const inRange$1 = (value, [low, high]) => value >= low && value <= high;
6038
+ const controlProblems$1 = (arm, expected) => {
6039
6039
  const problems = [];
6040
6040
  const { boot } = arm;
6041
6041
  if (boot === null) return ["the arm has no boot record: the guest did not boot"];
@@ -6076,11 +6076,11 @@ const faultProblems = (arm, expected) => {
6076
6076
  }
6077
6077
  const seconds = valueIn(read.elapsed, "s");
6078
6078
  times.push(seconds);
6079
- if (expected.each !== void 0 && !inRange(seconds, expected.each)) problems.push(`${id} took ${seconds} s, not ${range(expected.each)}`);
6079
+ if (expected.each !== void 0 && !inRange$1(seconds, expected.each)) problems.push(`${id} took ${seconds} s, not ${range(expected.each)}`);
6080
6080
  }
6081
6081
  if (expected.median !== void 0 && times.length > 0) {
6082
6082
  const middle = median(times);
6083
- if (!inRange(middle, expected.median)) problems.push(`the median of the cell ${expected.cell} is ${middle} s, not ${range(expected.median)}`);
6083
+ if (!inRange$1(middle, expected.median)) problems.push(`the median of the cell ${expected.cell} is ${middle} s, not ${range(expected.median)}`);
6084
6084
  }
6085
6085
  return problems;
6086
6086
  };
@@ -6088,7 +6088,81 @@ const faultProblems = (arm, expected) => {
6088
6088
  * This function gives each difference between the records of an arm `e4` and the result that a case expects. An arm
6089
6089
  * with no boot record, no record of the cell or no counted run gives a problem: a void arm does not pass.
6090
6090
  */
6091
- const vmArmProblems = (arm, cases) => cases.flatMap((each) => (each.kind === "control" ? controlProblems(arm, each) : faultProblems(arm, each)).map((problem) => `${each.name}: ${problem}`));
6091
+ const vmArmProblems = (arm, cases) => cases.flatMap((each) => (each.kind === "control" ? controlProblems$1(arm, each) : faultProblems(arm, each)).map((problem) => `${each.name}: ${problem}`));
6092
+ // src/k3s-tier.ts
6093
+ /** The kinds of fault that the gate of the k3s rung examines. */
6094
+ const K3S_TIER_FAULTS = ["node-loss"];
6095
+ /** The format of the record. The type holds it equal to the format that `k3s.ts` writes, with no import of `k3s.ts`. */
6096
+ const FORMAT = "harness-k3s/1";
6097
+ /** The nodes of the arm. Each needs its first boot in the record. */
6098
+ const NODES = ["server", "agent"];
6099
+ const inRange = (value, [low, high]) => value >= low && value <= high;
6100
+ const controlProblems = (record, expected) => {
6101
+ const problems = [];
6102
+ if (record.error !== null) problems.push(`the arm stopped: ${record.error}`);
6103
+ if (record.k3s !== expected.k3s) problems.push(`the arm operated k3s ${record.k3s}, not the pinned release ${expected.k3s}`);
6104
+ for (const node of NODES) {
6105
+ const boot = record.boots.find((each) => each.node === node);
6106
+ if (boot === void 0) {
6107
+ problems.push(`the record has no boot of the ${node}`);
6108
+ continue;
6109
+ }
6110
+ if (boot.kernel !== expected.kernel) problems.push(`the ${node} booted the kernel ${boot.kernel}, not the pinned kernel ${expected.kernel}`);
6111
+ if (!(boot.ms <= expected.bootMaxMs)) problems.push(`the boot of the ${node} took ${boot.ms} ms, not ${expected.bootMaxMs} ms or less`);
6112
+ }
6113
+ if (record.readyMs === null) problems.push("the two nodes were not Ready");
6114
+ else if (!(record.readyMs <= expected.readyMaxMs)) problems.push(`the two nodes were Ready in ${record.readyMs} ms, not ${expected.readyMaxMs} ms or less`);
6115
+ if (record.hold === null) problems.push("the record has no hold");
6116
+ else {
6117
+ if (!(record.hold.ms >= expected.holdMinMs)) problems.push(`the hold lasted ${record.hold.ms} ms, not ${expected.holdMinMs} ms or more`);
6118
+ if (record.hold.changes !== 0) problems.push(`the Ready condition of a node changed in ${record.hold.changes} of ${record.hold.polls} polls of the hold`);
6119
+ }
6120
+ return problems;
6121
+ };
6122
+ /** This function gives the counted runs, and a problem when they are too few. */
6123
+ const countedOf = (record, runsMin) => {
6124
+ const counted = record.runs.filter((run) => run.void === null);
6125
+ return {
6126
+ counted,
6127
+ problems: counted.length < runsMin ? [`the arm has ${counted.length} power-offs that are not void, not ${runsMin} or more`] : []
6128
+ };
6129
+ };
6130
+ const lossProblems = (record, expected) => {
6131
+ const { counted, problems } = countedOf(record, expected.runsMin);
6132
+ const [low, high] = expected.unknown;
6133
+ for (const run of counted) {
6134
+ const id = `the power-off ${run.index}`;
6135
+ if (run.killedAt === null) problems.push(`${id} has no time of the power-off`);
6136
+ else if (run.unknownAt === null) problems.push(`${id} gave no Ready condition Unknown`);
6137
+ else {
6138
+ const seconds = (run.unknownAt - run.killedAt) / 1e3;
6139
+ if (!inRange(seconds, expected.unknown)) problems.push(`${id} gave Unknown after ${seconds} s, not ${low} s to ${high} s`);
6140
+ }
6141
+ }
6142
+ return problems;
6143
+ };
6144
+ const returnProblems = (record, expected) => {
6145
+ const { counted, problems } = countedOf(record, expected.runsMin);
6146
+ for (const run of counted) {
6147
+ const id = `the power-off ${run.index}`;
6148
+ const { before, after } = run;
6149
+ if (run.readyAt === null) problems.push(`${id}: the agent was not Ready again`);
6150
+ if (before === null || after === null) {
6151
+ problems.push(`${id} has no pod ${before === null ? "before the power-off" : "after the return"}`);
6152
+ continue;
6153
+ }
6154
+ if (after.sandbox === "") problems.push(`${id}: the pod has no ready sandbox after the return`);
6155
+ else if (after.sandbox === before.sandbox && !(after.restarts > before.restarts)) problems.push(`${id}: the pod kept its sandbox ${before.sandbox.slice(0, 12)} and its restart count ${before.restarts}`);
6156
+ }
6157
+ return problems;
6158
+ };
6159
+ /**
6160
+ * This function gives each difference between the record of an arm of the k3s rung and the result that a case
6161
+ * expects. No record, a record of another format or no counted run gives a problem: a void arm does not pass.
6162
+ */
6163
+ const k3sArmProblems = (record, cases) => cases.flatMap((each) => {
6164
+ return (record === null ? ["the arm has no record"] : record.format !== FORMAT ? [`the record has the format ${String(record.format)}, not ${FORMAT}`] : each.kind === "control" ? controlProblems(record, each) : each.kind === "loss" ? lossProblems(record, each) : returnProblems(record, each)).map((problem) => `${each.name}: ${problem}`);
6165
+ });
6092
6166
  // src/disk.ts
6093
6167
  /**
6094
6168
  * The disk tier applies a disk plan of `@mark1russell7/rigor-chaos` to the files of a program. Each fault starts one new
@@ -10420,6 +10494,6 @@ const runCell = async (cell, say = () => {}) => {
10420
10494
  target = larger;
10421
10495
  }
10422
10496
  };
10423
- export { AWS_FROM, CELL_RECORD_FORMAT, CLIENT_CAPABILITIES, CLIENT_NAMES, CLOSED_TOLERANCE, CLOUDS, CLUSTER_STAGES, CONVERGE_MS, CPU_STATES, DAEMONS, DEBUG, DIRTY, DISK_MOUNT, DISK_RECORD_FORMAT, DISK_ROOT, DISK_SUBJECT, DISK_TIER_KINDS, DROP_HANDLING, FABRIC_CLIENT, FABRIC_DEVICE, FABRIC_RECORD_FORMAT, FABRIC_SINK_SCRIPT, FABRIC_STREAM_IMAGE, FABRIC_STREAM_INTERVAL_MS, FABRIC_STREAM_PORT, FABRIC_STREAM_SCRIPT, FABRIC_TARGET, FABRIC_TIER_FAULTS, FABRIC_TIER_TIMERS, FRR_IMAGE, GIVES_AWAY, HASH_SCRIPT, INJECT, INSERT, KAFKA_TAIL_MS, KEPT, LAYERS, LAYER_FACTS, LAYER_RIG_ENV, LIMITS, LINGER_MS, LISTING, LOAD_FORMAT, LOAD_PATH, LOAD_POOL_LIMIT, LOCK_NAMES, LOSS_MARGIN, MEMBER_MARKS, MONITOR_DOWN, NODE_MARKS, NOISE, PINNED, PUMP, PUMP_SLACK, QUIET_MS, RELATIVE, REPLICA_SET_STAGES, REPOSITORY, RESOURCES_EVENT, RESOURCES_PROGRAM, RESTART, RIG_TERMS, ROUTERS, SCHEDULE_PATH, SEED_DOCUMENT, SHIPPED_CLIENTS, SHIPPED_NAMES, STAGES, STANDBY_READY, STATUS_SCRIPT, STEPS, STEP_DOWN, TOXIC_RIG_TERMS, VM_TIER_FAULTS, amqpClientImage, arrivalOf, basesOf, bootstrapOf, brokerEnv, buildOf, buildRecordOf, callOf, cancelsOf, cargoVersions, cgroupKeyed, cgroupLimit, cgroupNumber, clockOffsetOf, closeOrExit, cloudOf, clusterArgs, clusterConf, clusterCutOf, clusterHostsOf, clusterOnce, clusterStagesOf, clusterViewOf, commitProblems, commitVoid, comparable, connectionsProblems, controllerEnv, cpuMaxOf, cpuShares, cpuStatOf, cpusOfList, crossingsOf, cutOf, deadlineOf, delayVoids, deliveryFinding, deliveryOf, deviceOf, diskLayerCommand, diskRecordProblems, diskSubjectProblems, diskTornCommand, drillOnce, drillSpan, dropFinding, dropOf, endpointAfter, envOf, environmentCounts, environmentProblems, errorsOf, estimateOf, estimateVerdict, exitOf, fabricFaultProblems, fabricRecordProblems, fabricStreamOf, fieldOf, fieldsOf, firstUnanswered, folderDigest, frrConf, goHttpImage, goVersions, groupOnce, groupVerdictOf, grpcClientImage, harnessImage, harnessRecord, harnessVersion, hashOf, highestHeld, hikariClientImage, hostLimitsOf, hzOf, imageOf, imagePinProblems, imageProblems, inContext, infoOf, initiateScript, isFenceLine, isHopPlace, jarVersions, jitterOf, jitterOfLines, judge, kafkaArgs, kafkaClientImage, kafkaCutOf, kafkaOnce, kafkaPauseOnce, kafkaViewOf, lagsOf, laterMove, latestEndOf, layerOf, leafLacks, leafRouteAfter, leftAfter, limitsOf, limitsProblems, loadOf, loadPlanOf, loadVerdict, locksOf, logNameOf, logTimeOf, manifestProblems, matches, measure, measureConntrack, measureDriver, measureEgress, measureGroup, measureMemory, measurePause, measurePorts, measureQueue, medianInterval, memAvailableOf, memberCommand, memberConfig, memberLineOf, memoryStatOf, mongoClientImage, monotonicAt, monotonicOf, namesGroup, networkOf, nodeClientImage, nodeCommand, nodeHttpImage, nodeIdOf, nodeLineOf, nodeNameOf, nodesOnMonotonic, noiseOf, npmDrift, npmVersions, numbersOf, onMonotonic, openClusterLab, openDiskLab, openFabric, openFabricLab, openGroupLab, openKafkaLab, openLab, openReplicaSetLab, openStandby, pairArgs, pairOnce, pairingOf, pairingsOf, pauseReady, peersOf, pgClientImage, pingsOf, plainOf, planOf, pongsOf, poolOf, programLines, programOf, quantileOf, readCpu, readCpus, readHost, readOplog, reconnectFinding, reconnectOf, recordProblems, recoveryFindings, recoveryOf, referenceOf, reorderingOf, replicaSetArgs, replicaSetOnce, replicaSetStagesOf, requestOf, requestWords, resourceArgs, resourceChange, resourceReader, resourceReadingIn, resourceReadingOf, restamped, rigTermsOf, roomNeeded, roomVoidOf, routeLine, routerImage, routesOf, runCell, runCpusOf, runDiskFault, runFabricFault, seedScript, sentinelConfig, sessionsOf, shippedClientRecord, shippedSource, silenceDrops, sliceQuery, socketAt, socketOf, socketsOf, spread, spreadOf, stagesOf, standaloneCommand, standbyCommand, statusViewOf, stealShare, stepBand, stopScript, streamEnded, streamOf, streamsLoadOf, subjectClient, subjectProblems, subscriptionsOf, substrateHere, substrateKey, substrateOf, substrateOn, targetImageOf, targetSourceOf, templated, toolJsonOf, topicOf, topologyOf, toxicBody, unlockedManifests, unpinnedBases, unpoolable, verdictOf, versionsOf, viewOf, vmArmProblems, writesOf };
10497
+ export { AWS_FROM, CELL_RECORD_FORMAT, CLIENT_CAPABILITIES, CLIENT_NAMES, CLOSED_TOLERANCE, CLOUDS, CLUSTER_STAGES, CONVERGE_MS, CPU_STATES, DAEMONS, DEBUG, DIRTY, DISK_MOUNT, DISK_RECORD_FORMAT, DISK_ROOT, DISK_SUBJECT, DISK_TIER_KINDS, DROP_HANDLING, FABRIC_CLIENT, FABRIC_DEVICE, FABRIC_RECORD_FORMAT, FABRIC_SINK_SCRIPT, FABRIC_STREAM_IMAGE, FABRIC_STREAM_INTERVAL_MS, FABRIC_STREAM_PORT, FABRIC_STREAM_SCRIPT, FABRIC_TARGET, FABRIC_TIER_FAULTS, FABRIC_TIER_TIMERS, FRR_IMAGE, GIVES_AWAY, HASH_SCRIPT, INJECT, INSERT, K3S_TIER_FAULTS, KAFKA_TAIL_MS, KEPT, LAYERS, LAYER_FACTS, LAYER_RIG_ENV, LIMITS, LINGER_MS, LISTING, LOAD_FORMAT, LOAD_PATH, LOAD_POOL_LIMIT, LOCK_NAMES, LOSS_MARGIN, MEMBER_MARKS, MONITOR_DOWN, NODE_MARKS, NOISE, PINNED, PUMP, PUMP_SLACK, QUIET_MS, RELATIVE, REPLICA_SET_STAGES, REPOSITORY, RESOURCES_EVENT, RESOURCES_PROGRAM, RESTART, RIG_TERMS, ROUTERS, SCHEDULE_PATH, SEED_DOCUMENT, SHIPPED_CLIENTS, SHIPPED_NAMES, STAGES, STANDBY_READY, STATUS_SCRIPT, STEPS, STEP_DOWN, TOXIC_RIG_TERMS, VM_TIER_FAULTS, amqpClientImage, arrivalOf, basesOf, bootstrapOf, brokerEnv, buildOf, buildRecordOf, callOf, cancelsOf, cargoVersions, cgroupKeyed, cgroupLimit, cgroupNumber, clockOffsetOf, closeOrExit, cloudOf, clusterArgs, clusterConf, clusterCutOf, clusterHostsOf, clusterOnce, clusterStagesOf, clusterViewOf, commitProblems, commitVoid, comparable, connectionsProblems, controllerEnv, cpuMaxOf, cpuShares, cpuStatOf, cpusOfList, crossingsOf, cutOf, deadlineOf, delayVoids, deliveryFinding, deliveryOf, deviceOf, diskLayerCommand, diskRecordProblems, diskSubjectProblems, diskTornCommand, drillOnce, drillSpan, dropFinding, dropOf, endpointAfter, envOf, environmentCounts, environmentProblems, errorsOf, estimateOf, estimateVerdict, exitOf, fabricFaultProblems, fabricRecordProblems, fabricStreamOf, fieldOf, fieldsOf, firstUnanswered, folderDigest, frrConf, goHttpImage, goVersions, groupOnce, groupVerdictOf, grpcClientImage, harnessImage, harnessRecord, harnessVersion, hashOf, highestHeld, hikariClientImage, hostLimitsOf, hzOf, imageOf, imagePinProblems, imageProblems, inContext, infoOf, initiateScript, isFenceLine, isHopPlace, jarVersions, jitterOf, jitterOfLines, judge, k3sArmProblems, kafkaArgs, kafkaClientImage, kafkaCutOf, kafkaOnce, kafkaPauseOnce, kafkaViewOf, lagsOf, laterMove, latestEndOf, layerOf, leafLacks, leafRouteAfter, leftAfter, limitsOf, limitsProblems, loadOf, loadPlanOf, loadVerdict, locksOf, logNameOf, logTimeOf, manifestProblems, matches, measure, measureConntrack, measureDriver, measureEgress, measureGroup, measureMemory, measurePause, measurePorts, measureQueue, medianInterval, memAvailableOf, memberCommand, memberConfig, memberLineOf, memoryStatOf, mongoClientImage, monotonicAt, monotonicOf, namesGroup, networkOf, nodeClientImage, nodeCommand, nodeHttpImage, nodeIdOf, nodeLineOf, nodeNameOf, nodesOnMonotonic, noiseOf, npmDrift, npmVersions, numbersOf, onMonotonic, openClusterLab, openDiskLab, openFabric, openFabricLab, openGroupLab, openKafkaLab, openLab, openReplicaSetLab, openStandby, pairArgs, pairOnce, pairingOf, pairingsOf, pauseReady, peersOf, pgClientImage, pingsOf, plainOf, planOf, pongsOf, poolOf, programLines, programOf, quantileOf, readCpu, readCpus, readHost, readOplog, reconnectFinding, reconnectOf, recordProblems, recoveryFindings, recoveryOf, referenceOf, reorderingOf, replicaSetArgs, replicaSetOnce, replicaSetStagesOf, requestOf, requestWords, resourceArgs, resourceChange, resourceReader, resourceReadingIn, resourceReadingOf, restamped, rigTermsOf, roomNeeded, roomVoidOf, routeLine, routerImage, routesOf, runCell, runCpusOf, runDiskFault, runFabricFault, seedScript, sentinelConfig, sessionsOf, shippedClientRecord, shippedSource, silenceDrops, sliceQuery, socketAt, socketOf, socketsOf, spread, spreadOf, stagesOf, standaloneCommand, standbyCommand, statusViewOf, stealShare, stepBand, stopScript, streamEnded, streamOf, streamsLoadOf, subjectClient, subjectProblems, subscriptionsOf, substrateHere, substrateKey, substrateOf, substrateOn, targetImageOf, targetSourceOf, templated, toolJsonOf, topicOf, topologyOf, toxicBody, unlockedManifests, unpinnedBases, unpoolable, verdictOf, versionsOf, viewOf, vmArmProblems, writesOf };
10424
10498
 
10425
10499
  //# sourceMappingURL=index.js.map