@mark1russell7/harness 0.15.5 → 0.15.6

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/build/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { A as unlockedManifests, B as environmentProblems, C as programOf, D as subjectProblems, E as subjectClient, F as jarVersions, H as latestEndOf, I as locksOf, L as npmVersions, M as LOCK_NAMES, N as cargoVersions, O as targetImageOf, P as goVersions, R as versionsOf, S as planOf, T as shippedSource, U as requestFirst, V as isHopPlace, _ as kafkaClientImage, a as SHIPPED_NAMES, b as nodeHttpImage, c as buildRecordOf, d as harnessImage, f as harnessVersion, g as inContext, h as imageProblems, i as SHIPPED_CLIENTS, j as unpinnedBases, k as targetSourceOf, l as goHttpImage, m as imageOf, n as PINNED, o as amqpClientImage, p as hikariClientImage, r as REPOSITORY, s as basesOf, t as CLIENT_NAMES, u as grpcClientImage, v as mongoClientImage, w as routerImage, x as pgClientImage, y as nodeClientImage, z as CLIENT_CAPABILITIES } from "./image-D88I5WA_.js";
1
+ import { A as unlockedManifests, B as environmentProblems, C as programOf, D as subjectProblems, E as subjectClient, F as jarVersions, H as latestEndOf, I as locksOf, L as npmVersions, M as LOCK_NAMES, N as cargoVersions, O as targetImageOf, P as goVersions, R as versionsOf, S as planOf, T as shippedSource, U as requestFirst, V as isHopPlace, _ as kafkaClientImage, a as SHIPPED_NAMES, b as nodeHttpImage, c as buildRecordOf, d as harnessImage, f as harnessVersion, g as inContext, h as imageProblems, i as SHIPPED_CLIENTS, j as unpinnedBases, k as targetSourceOf, l as goHttpImage, m as imageOf, n as PINNED, o as amqpClientImage, p as hikariClientImage, r as REPOSITORY, s as basesOf, t as CLIENT_NAMES, u as grpcClientImage, v as mongoClientImage, w as routerImage, x as pgClientImage, y as nodeClientImage, z as CLIENT_CAPABILITIES } from "./image-CsPgXjcZ.js";
2
2
  import { quantity, valueIn } from "@mark1russell7/quantity";
3
3
  import { median, medianInterval as medianInterval$1, quantile, quantileSorted } from "@mark1russell7/rigor-statistics";
4
4
  import { rungVerdict } from "@mark1russell7/rigor-bench";
@@ -9,7 +9,7 @@ import { mkdtemp, rm, writeFile } from "node:fs/promises";
9
9
  import { release, tmpdir } from "node:os";
10
10
  import { join } from "node:path";
11
11
  import { existsSync, readFileSync } from "node:fs";
12
- //#region src/load.ts
12
+ // src/load.ts
13
13
  /**
14
14
  * The measure and the verdict of an open-loop cell (SYS-68). A client on a schedule sends each
15
15
  * arrival at its time, thus a stall counts in each arrival that it delayed. The package rigor-chaos
@@ -303,8 +303,7 @@ const estimateVerdict = (estimates) => {
303
303
  words: `The estimate of the open loop puts back ${hidden} hidden sends, with ${gaps}: ${spread}.`
304
304
  };
305
305
  };
306
- //#endregion
307
- //#region src/verdict.ts
306
+ // src/verdict.ts
308
307
  /** This function gives the words of the outcome of a second request: its connection, a retry, and its end. */
309
308
  const requestWords = (outcome) => `${outcome.connection}${outcome.retried ? ", a retry" : ""}, ${outcome.pending === true ? "pending" : outcome.error ?? "a reply"}`;
310
309
  /**
@@ -858,8 +857,7 @@ const verdictOfBand = (prediction, runs, delta = NOISE) => {
858
857
  why: `${counts}; ${centre} straddles the band`
859
858
  };
860
859
  };
861
- //#endregion
862
- //#region src/application.ts
860
+ // src/application.ts
863
861
  /**
864
862
  * This module reads the acts of the program of the observer: its heartbeat, its drop of the
865
863
  * connection, its reconnect and its call in flight. The kernel has no report of a detection by
@@ -1007,6 +1005,11 @@ const jitterOfLines = (lines, socket, local, until) => {
1007
1005
  /** This function gives each ping of the program on the connection, with the kernel's stamp of its write in the pairing window (`delta`). */
1008
1006
  const pingsOf = (lines, socket, local, delta = NOISE) => lines.filter((line) => line.ev === "ping" && onConnection(line, local)).map((line) => eventOf(socket, line, isWrite, delta));
1009
1007
  /**
1008
+ * This function gives each pong of the program on the connection: each `write` line with the type
1009
+ * `pong`. Each pong has the kernel's stamp of its write in the pairing window (`delta`).
1010
+ */
1011
+ const pongsOf = (lines, socket, local, delta = NOISE) => lines.filter((line) => line.ev === "write" && line["type"] === "pong" && onConnection(line, local)).map((line) => eventOf(socket, line, isWrite, delta));
1012
+ /**
1010
1013
  * This function gives the first ping that got no answer: no segment with data reached the socket
1011
1014
  * after its write, up to `until`. Its write starts the wait of the heartbeat that the fault met.
1012
1015
  */
@@ -1075,8 +1078,63 @@ const callOf = (events, request, detected) => {
1075
1078
  after: detected === void 0 ? null : between$4(detected, end.t)
1076
1079
  };
1077
1080
  };
1078
- //#endregion
1079
- //#region src/driver.ts
1081
+ // src/delivery.ts
1082
+ /**
1083
+ * This function gives the stream of a cell with a delivery law. It throws for a cell with no count
1084
+ * of events: the law has no last event without it. It also throws for a target without its lines
1085
+ * (`Target.lines`): the law reads the lines of the two programs.
1086
+ */
1087
+ const streamOf = (cell) => {
1088
+ const { count, sender } = cell.probe;
1089
+ if (cell.probe.mode !== "stream" || count === void 0 || count < 1) throw new RangeError(`${cell.name}: a delivery law needs a stream of 1 or more events (probe.mode "stream" and probe.count)`);
1090
+ if (cell.target.lines !== true) throw new RangeError(`${cell.name}: a delivery law needs the lines of the target (target.lines)`);
1091
+ return {
1092
+ count,
1093
+ sender: sender ?? "client"
1094
+ };
1095
+ };
1096
+ /** This function gives the numbers of the lines `ev` of a program: the field `n` of each. */
1097
+ const numbersOf$1 = (lines, ev) => lines.filter((line) => line.ev === ev && typeof line["n"] === "number").map((line) => line["n"]);
1098
+ /** This function gives the lines of the sender and of the receiver of a stream, in that sequence. */
1099
+ const sidesOf = (run, stream) => stream.sender === "client" ? [run.events, run.server ?? []] : [run.server ?? [], run.events];
1100
+ /** This function tells that the receiver of a stream got its last event: the end of the wait of a run. */
1101
+ const streamEnded = (run, stream) => numbersOf$1(sidesOf(run, stream)[1], "got").includes(stream.count);
1102
+ /** This function gives what a run of a stream delivered. */
1103
+ const deliveryOf = (run, stream) => {
1104
+ const [sender, receiver] = sidesOf(run, stream);
1105
+ const emitted = new Set(numbersOf$1(sender, "emitted"));
1106
+ const got = numbersOf$1(receiver, "got");
1107
+ const distinct = new Set(got);
1108
+ const second = run.events.filter((line) => line.ev === "status" && line["status"] === "connected")[1];
1109
+ return {
1110
+ emitted: emitted.size,
1111
+ got: distinct.size,
1112
+ lost: [...emitted].filter((n) => !distinct.has(n)).length,
1113
+ duplicates: got.length - distinct.size,
1114
+ unknown: [...distinct].filter((n) => !emitted.has(n)).length,
1115
+ recovered: second === void 0 ? null : second["recovered"] === true,
1116
+ ended: distinct.has(stream.count)
1117
+ };
1118
+ };
1119
+ /** This function tells that a count is outside its band. */
1120
+ const outside = (band, value) => value < band.low || value > band.high;
1121
+ /** This function gives the words of a count band. */
1122
+ const bandWords$1 = (band) => band.low === band.high ? `${band.low}` : `${band.low} to ${band.high}`;
1123
+ /** This function gives the finding of a run of a stream against its law, or null when the run holds it. */
1124
+ const deliveryFinding = (prediction, stream, read) => {
1125
+ const sender = `the ${stream.sender}`;
1126
+ const receiver = stream.sender === "client" ? "the target" : "the client";
1127
+ const found = [
1128
+ read.emitted === stream.count ? null : `${sender} emitted ${read.emitted} of the ${stream.count} events of the stream`,
1129
+ read.ended ? null : `${receiver} did not get event ${stream.count}, the last of the stream`,
1130
+ read.unknown === 0 ? null : `${receiver} got ${read.unknown} events that ${sender} did not emit`,
1131
+ outside(prediction.lost, read.lost) ? `${receiver} lost ${read.lost} events, outside ${bandWords$1(prediction.lost)}` : null,
1132
+ outside(prediction.duplicates, read.duplicates) ? `${receiver} got ${read.duplicates} extra copies, outside ${bandWords$1(prediction.duplicates)}` : null,
1133
+ prediction.recovered === void 0 || read.recovered === prediction.recovered ? null : read.recovered === null ? "the client made no second connection, thus it gave no value of recovered" : `the second connection of the client has recovered ${read.recovered}, not ${prediction.recovered}`
1134
+ ].filter((each) => each !== null);
1135
+ return found.length === 0 ? null : found.join(". ");
1136
+ };
1137
+ // src/driver.ts
1080
1138
  /** These are the errno numbers that the kernel reports to a socket, by the names that predictions use. */
1081
1139
  const ERRNO$1 = {
1082
1140
  32: "EPIPE",
@@ -1524,8 +1582,7 @@ const measureDriver = (cell, run) => {
1524
1582
  finding: findings[0] ?? null
1525
1583
  };
1526
1584
  };
1527
- //#endregion
1528
- //#region src/queue.ts
1585
+ // src/queue.ts
1529
1586
  /** This bit is the SYN of the flags of an `rx` record of the prober. */
1530
1587
  const SYN = 2;
1531
1588
  /** This function gives the time between two stamps of CLOCK_MONOTONIC. */
@@ -1686,8 +1743,7 @@ const measureQueue = (run, expected) => {
1686
1743
  queue
1687
1744
  };
1688
1745
  };
1689
- //#endregion
1690
- //#region src/conntrack.ts
1746
+ // src/conntrack.ts
1691
1747
  /** This errno tells that a connect got a slot. */
1692
1748
  const NONE = "none";
1693
1749
  const numberOr = (line, field) => {
@@ -1802,8 +1858,7 @@ const measureConntrack = (run, expected) => {
1802
1858
  conntrack
1803
1859
  };
1804
1860
  };
1805
- //#endregion
1806
- //#region src/pause.ts
1861
+ // src/pause.ts
1807
1862
  /** This expression finds the stamp of a log line of a broker, as its console writes it, on UTC. */
1808
1863
  const LOG_TIME = /\[(\d{4})-(\d\d)-(\d\d) (\d\d):(\d\d):(\d\d),(\d{3})\]/;
1809
1864
  /** This function gives the time of a log line on the monotonic clock of a member, in ns, from the `start` line of that member. It is null for a line with no stamp. */
@@ -1965,8 +2020,7 @@ const measurePause = (run, prediction) => {
1965
2020
  pause: pauseReading
1966
2021
  };
1967
2022
  };
1968
- //#endregion
1969
- //#region src/ports.ts
2023
+ // src/ports.ts
1970
2024
  /** This errno ends a search that found no port. */
1971
2025
  const NO_PORT = "EADDRNOTAVAIL";
1972
2026
  const portsOf = (line) => Array.isArray(line["ports"]) ? line["ports"].filter((port) => typeof port === "number") : [];
@@ -2054,8 +2108,7 @@ const measurePorts = (run, expected) => {
2054
2108
  ports
2055
2109
  };
2056
2110
  };
2057
- //#endregion
2058
- //#region src/recovery.ts
2111
+ // src/recovery.ts
2059
2112
  /**
2060
2113
  * This module holds the pure parts of a recovery drill. These are the scripts of the shell, the reader
2061
2114
  * of the output of `bsondump`, and the set check of a recovery. It has no container, thus unit tests
@@ -2249,8 +2302,7 @@ const recoveryFindings = (measured, writes) => {
2249
2302
  if (measured.afterBackup !== null && lost !== null && Math.abs(lost - measured.afterBackup) > 2) findings.push(`the restore lost ${lost} accepted writes, and ${measured.afterBackup} came after the last backup`);
2250
2303
  return findings;
2251
2304
  };
2252
- //#endregion
2253
- //#region src/timeline.ts
2305
+ // src/timeline.ts
2254
2306
  /**
2255
2307
  * This module measures a run of a group cell. It gives the first write that a primary accepted
2256
2308
  * after the fault, and the timeline of the group. The Sentinels of a group announce its timeline.
@@ -2741,8 +2793,7 @@ const measureGroup = (cell, run) => {
2741
2793
  group
2742
2794
  };
2743
2795
  };
2744
- //#endregion
2745
- //#region src/observe.ts
2796
+ // src/observe.ts
2746
2797
  /** These are the errno numbers that the kernel reports to a socket, by the names that predictions use. */
2747
2798
  const ERRNO = {
2748
2799
  32: "EPIPE",
@@ -2762,7 +2813,7 @@ const count = (event, field) => event === void 0 ? 0 : Number(event[field] ?? 0)
2762
2813
  /** This function gives the view of the client on the same interval: TCP_INFO, with a sample each 2 ms. */
2763
2814
  const socketVantage = (cell, events, ready, request) => {
2764
2815
  const { from } = cell.prediction.detects === true ? cell.prediction : { from: void 0 };
2765
- if (from === void 0 || from === "peer-closed" || from === "fault" || from === "ping-sent" || from === "first-sent" || from === "last-data" || from === "last-reply") return null;
2816
+ if (from === void 0 || from === "peer-closed" || from === "fault" || from === "ping-sent" || from === "pong-sent" || from === "first-sent" || from === "last-data" || from === "last-reply") return null;
2766
2817
  const ended = events.find((event) => event.ev === "error" || event.ev === "eof");
2767
2818
  const reference = from === "last-received" ? ready : from === "request-sent" ? request : events.find((event) => event.ev === "kernel" && event.t >= request.t && count(event, "retransmits") > 0);
2768
2819
  return ended === void 0 || reference === void 0 ? null : between(reference.t, ended.t);
@@ -3144,6 +3195,7 @@ const measureSocket = (cell, run) => {
3144
3195
  if (from === "fault") return run.fault?.t0;
3145
3196
  if (from === "client-start") return (events.find((event) => event.ev === "connecting") ?? events[0])?.t;
3146
3197
  if (from === "ping-sent") return firstUnanswered(pings, socket, ended)?.at;
3198
+ if (from === "pong-sent") return pongsOf(lines, socket, named, paired).filter((pong) => pong.at <= before).at(-1)?.at;
3147
3199
  const record = from === "last-received" ? socket.filter((each) => each.ev === "rx" && each.mono <= before).at(-1) : from === "last-data" ? socket.filter((each) => each.ev === "rx" && (each.seg?.len.value ?? 0) > 0 && each.mono <= (ended ?? before)).at(-1) : from === "last-reply" ? socket.filter((each) => each.ev === "rx" && (each.seg?.len.value ?? 0) > 0 && each.mono < (ended ?? Infinity)).at(-1) : from === "first-retransmission" ? retransmitted.find((each) => each.why === "rto" && each.mono > before) : from === "first-sent" ? socket.find((each) => each.ev === "tx" && each.mono > before && (each.seg?.len.value ?? 0) > 0) : from === "syn-sent" ? socket.find((each) => each.ev === "state" && newState(each) === 2) : from === "peer-closed" ? kernel.find((each) => each.netns === peerNetns && each.cookie === peerCookie && each.ev === "state" && oldState(each) === 1) : void 0;
3148
3200
  if (record === void 0 && from === "peer-closed" && peerCookie === void 0) return proxiedClose(run);
3149
3201
  return record?.mono;
@@ -3346,10 +3398,14 @@ const measureSocket = (cell, run) => {
3346
3398
  exited: void 0
3347
3399
  } : closeOrExit(drop.line, closed, exitOf(run, cookie), noiseOf(cell));
3348
3400
  const how = prediction.drop === void 0 || drop === void 0 || left === void 0 ? null : dropFinding(prediction.drop, drop, left, paired, exited);
3401
+ const stream = prediction.delivery === void 0 ? void 0 : streamOf(cell);
3402
+ const delivery = stream === void 0 ? void 0 : deliveryOf(run, stream);
3403
+ const delivered = prediction.delivery === void 0 || stream === void 0 || delivery === void 0 ? null : deliveryFinding(prediction.delivery, stream, delivery);
3349
3404
  const found = [
3350
3405
  matches ? null : `it ended with ${words}, not ${prediction.errno}`,
3351
3406
  late,
3352
- how
3407
+ how,
3408
+ delivered
3353
3409
  ].filter((each) => each !== null);
3354
3410
  const finding = found.length === 0 ? null : found.join(". ");
3355
3411
  const programTimer = cell.probe.http !== void 0 && prediction.from === "last-received" && prediction.timer !== "keepalive";
@@ -3381,6 +3437,7 @@ const measureSocket = (cell, run) => {
3381
3437
  noticed,
3382
3438
  steps,
3383
3439
  ...reconnect === void 0 ? {} : { reconnect },
3440
+ ...delivery === void 0 ? {} : { delivery },
3384
3441
  ...left === void 0 ? {} : { left },
3385
3442
  ...exited === void 0 ? {} : { exited },
3386
3443
  ...cell.probe.ws !== void 0 && inflight ? { call: callOf(events, request, ended) } : {},
@@ -3388,8 +3445,7 @@ const measureSocket = (cell, run) => {
3388
3445
  finding
3389
3446
  };
3390
3447
  };
3391
- //#endregion
3392
- //#region src/fabric.ts
3448
+ // src/fabric.ts
3393
3449
  /**
3394
3450
  * A fabric is a routed network between the client and the target, on layer E3 (docs/S7.md). Four
3395
3451
  * routers of FRRouting, two leaves and two spines, run real BGP over veth pairs that containerlab
@@ -3822,8 +3878,7 @@ const openFabric = async (parts) => {
3822
3878
  throw error;
3823
3879
  }
3824
3880
  };
3825
- //#endregion
3826
- //#region src/substrate.ts
3881
+ // src/substrate.ts
3827
3882
  /**
3828
3883
  * A layer is a rung of the laboratory (`docs/S7.md`). E1 is containers on one kernel, and E2 is a
3829
3884
  * cluster of containers on one kernel. A lab with `Topology.fabric` writes E3: routers in containers.
@@ -3950,8 +4005,7 @@ const unpoolable = (substrates) => {
3950
4005
  if (b !== void 0) return [a, b];
3951
4006
  }
3952
4007
  };
3953
- //#endregion
3954
- //#region src/lab.ts
4008
+ // src/lab.ts
3955
4009
  /** This function loads Testcontainers when a lab first opens. Code that only measures and judges does not load it. */
3956
4010
  const containers = () => import("testcontainers");
3957
4011
  /**
@@ -4001,7 +4055,8 @@ const LIFT = {
4001
4055
  blackhole: "clear",
4002
4056
  rst: "clear-rst",
4003
4057
  reject: "clear-reject",
4004
- mtu: "clear-mtu"
4058
+ mtu: "clear-mtu",
4059
+ "fin-ack": "clear-fin-ack"
4005
4060
  };
4006
4061
  /** This function collects the JSON lines of a program. It gives each line to `also` too, when the caller gives it. */
4007
4062
  const lines = (also) => {
@@ -5027,8 +5082,7 @@ const openLab = async (target, kind = "tcp", topology) => {
5027
5082
  throw error;
5028
5083
  }
5029
5084
  };
5030
- //#endregion
5031
- //#region src/standby.ts
5085
+ // src/standby.ts
5032
5086
  /**
5033
5087
  * This module is the second server of a pair (`Cell.pair`). The lab of the cell has the primary, the
5034
5088
  * topology in front of it, the injector and the prober. This module adds one standby on the network
@@ -5234,8 +5288,7 @@ const pairOnce = async (lab, standby, cell, environment, index, dry = false) =>
5234
5288
  }
5235
5289
  };
5236
5290
  };
5237
- //#endregion
5238
- //#region src/pins.ts
5291
+ // src/pins.ts
5239
5292
  /**
5240
5293
  * This module tells if a manifest pins each program that a run operated. A record that does not pin
5241
5294
  * them is not a record. A later run cannot operate the same programs, thus nobody can reproduce
@@ -5297,8 +5350,7 @@ const recordProblems = (record) => [.../* @__PURE__ */ new Set([
5297
5350
  ...record.manifests.flatMap((manifest) => manifestProblems(manifest)),
5298
5351
  ...record.debug === true ? [DEBUG] : []
5299
5352
  ])];
5300
- //#endregion
5301
- //#region src/group.ts
5353
+ // src/group.ts
5302
5354
  /** This function gives the configuration file of a member: its port, its settings, and the primary that a replica follows. */
5303
5355
  const memberConfig = (group, primary) => [
5304
5356
  `port ${group.port}`,
@@ -5983,8 +6035,7 @@ const groupOnce = async (lab, cell, environment, index) => {
5983
6035
  }
5984
6036
  };
5985
6037
  };
5986
- //#endregion
5987
- //#region src/replset.ts
6038
+ // src/replset.ts
5988
6039
  /** These are the components of the log of mongod that a run keeps: replication, its heartbeats, the elections, the rollbacks and the commands. */
5989
6040
  const KEPT = /* @__PURE__ */ new Set([
5990
6041
  "REPL",
@@ -6629,8 +6680,7 @@ const replicaSetOnce = async (lab, cell, environment, index) => {
6629
6680
  }
6630
6681
  };
6631
6682
  };
6632
- //#endregion
6633
- //#region src/drill.ts
6683
+ // src/drill.ts
6634
6684
  /**
6635
6685
  * This module does one run of a recovery drill on the lab of a replica set. A drill stops the store
6636
6686
  * during writes, removes its disk, and recovers from real backups, or by an election.
@@ -6979,8 +7029,7 @@ const drillOnce = async (lab, cell, environment, index) => {
6979
7029
  }
6980
7030
  };
6981
7031
  };
6982
- //#endregion
6983
- //#region src/cluster.ts
7032
+ // src/cluster.ts
6984
7033
  /** This form is a line of the console log of RabbitMQ 4.3: the time with its offset, the level, the process and the message. */
6985
7034
  const LINE = /^(\d{4}-\d\d-\d\d) (\d\d:\d\d:\d\d)\.(\d{3})(\d*)([+-]\d\d:\d\d) \[(\w+)\] <[^>]*> (.*)$/;
6986
7035
  /** This form is an escape of ANSI: RabbitMQ colors each line of its console by its level. */
@@ -7721,8 +7770,7 @@ const clusterOnce = async (lab, cell, environment, index) => {
7721
7770
  }
7722
7771
  };
7723
7772
  };
7724
- //#endregion
7725
- //#region src/kafka.ts
7773
+ // src/kafka.ts
7726
7774
  /**
7727
7775
  * This module is the lab of a group of Kafka brokers in KRaft mode with one controller. It opens one
7728
7776
  * environment for a Kafka cell, for the runs of the cell. Each node is a container from the stock
@@ -8367,8 +8415,7 @@ const kafkaPauseOnce = async (lab, cell, environment, index) => {
8367
8415
  }
8368
8416
  };
8369
8417
  };
8370
- //#endregion
8371
- //#region src/run.ts
8418
+ // src/run.ts
8372
8419
  /**
8373
8420
  * This function measures and judges the raw records of a cell, with the code of the harness at
8374
8421
  * this time. `runCell` uses it during a cell. A holder of the raw records of a cell can use it
@@ -8386,6 +8433,15 @@ const droppedSoFar = (records) => {
8386
8433
  for (let at = records.length - 1; at >= 0; at -= 1) if (records[at].ev === "clock") return Number(records[at]["lost"] ?? 0);
8387
8434
  return 0;
8388
8435
  };
8436
+ /**
8437
+ * This function gives the length in seconds of the stream of a WebSocket client: `count` events,
8438
+ * one each `interval`. It throws for a stream without them.
8439
+ */
8440
+ const streamLength = (cell) => {
8441
+ const { count, interval } = cell.probe;
8442
+ if (count === void 0 || interval === void 0) throw new RangeError(`${cell.name}: a stream of a WebSocket client needs probe.count and probe.interval`);
8443
+ return count * valueIn(interval, "s");
8444
+ };
8389
8445
  /** This function gives the argv of the client for a cell, with a deadline far after all that it waits for. */
8390
8446
  const probeArgs = (cell, lab) => {
8391
8447
  const { prediction, probe } = cell;
@@ -8407,7 +8463,10 @@ const probeArgs = (cell, lab) => {
8407
8463
  args.push("--request-timeout-ms", String(valueIn(ws.requestTimeout, "ms")));
8408
8464
  args.push("--connection-timeout-ms", String(valueIn(ws.connectionTimeout, "ms")));
8409
8465
  if (ws.hold !== void 0) args.push("--hold-ms", String(valueIn(ws.hold, "ms")));
8410
- args.push("--max-s", String(Math.ceil((longest + waits) * 2 + 10)));
8466
+ if (ws.retries !== void 0) args.push("--retries", String(ws.retries));
8467
+ const stream = probe.mode === "stream" ? streamLength(cell) : 0;
8468
+ if (probe.mode === "stream") args.push("--count", String(probe.count), "--interval-ms", String(valueIn(probe.interval, "ms")), "--sender", probe.sender ?? "client");
8469
+ args.push("--max-s", String(Math.ceil((longest + waits + stream) * 2 + 10)));
8411
8470
  return args;
8412
8471
  }
8413
8472
  if (probe.http !== void 0) {
@@ -8736,6 +8795,7 @@ const once = async (lab, cell, environment, index, dry = false) => {
8736
8795
  case "mtu-blackhole": return lab.fault("mtu", cell.faultAt ?? "client", { above: cell.mtu ?? 1200 });
8737
8796
  case "netem": return netemOn(cell.netem);
8738
8797
  case "rst": return lab.fault("rst", faultAt);
8798
+ case "fin-ack": return lab.fault("fin-ack", cell.faultAt ?? "client");
8739
8799
  case "middlebox-forget":
8740
8800
  case "proxy-idle":
8741
8801
  case "app-stall":
@@ -8801,6 +8861,7 @@ const once = async (lab, cell, environment, index, dry = false) => {
8801
8861
  await netemOn(void 0);
8802
8862
  return;
8803
8863
  case "rst": return lab.lift("rst", faultAt);
8864
+ case "fin-ack": return lab.lift("fin-ack", cell.faultAt ?? "client");
8804
8865
  case "toxic":
8805
8866
  await lab.toxic(null);
8806
8867
  return;
@@ -8884,6 +8945,18 @@ const once = async (lab, cell, environment, index, dry = false) => {
8884
8945
  const waits = expected.waits.reduce((sum, wait) => sum + valueIn(wait.high, "s"), 0);
8885
8946
  await dials(probe, 1 + expected.waits.length, waits * 2e3 + 5e3);
8886
8947
  }
8948
+ if ((cell.prediction.detects === true ? cell.prediction.delivery : void 0) !== void 0) {
8949
+ const stream = streamOf(cell);
8950
+ const within = streamLength(cell) * 2e3 + 1e4;
8951
+ const started = Date.now();
8952
+ const stopped = () => probe.events.some((event) => event.ev === "deadline" || event.ev === "fail");
8953
+ const current = () => ({
8954
+ ...partial(),
8955
+ server: lab.server.slice(serverFrom)
8956
+ });
8957
+ while (!streamEnded(current(), stream) && !stopped() && Date.now() - started < within) await sleep(20);
8958
+ await sleep(TAIL_MS);
8959
+ }
8887
8960
  }
8888
8961
  } finally {
8889
8962
  await probe.stop();
@@ -9195,7 +9268,6 @@ const runCell = async (cell, say = () => {}) => {
9195
9268
  target = larger;
9196
9269
  }
9197
9270
  };
9198
- //#endregion
9199
- export { AWS_FROM, CLIENT_CAPABILITIES, CLIENT_NAMES, CLOSED_TOLERANCE, CLOUDS, CLUSTER_STAGES, CONVERGE_MS, DAEMONS, DEBUG, DIRTY, DROP_HANDLING, FABRIC_CLIENT, FABRIC_DEVICE, FABRIC_TARGET, FRR_IMAGE, GIVES_AWAY, HASH_SCRIPT, INJECT, INSERT, KAFKA_TAIL_MS, KEPT, LAYERS, LINGER_MS, LISTING, LOAD_FORMAT, LOAD_PATH, LOCK_NAMES, LOSS_MARGIN, MEMBER_MARKS, MONITOR_DOWN, NODE_MARKS, NOISE, PINNED, PUMP, PUMP_SLACK, QUIET_MS, RELATIVE, REPLICA_SET_STAGES, REPOSITORY, RESTART, ROUTERS, SCHEDULE_PATH, SEED_DOCUMENT, SHIPPED_CLIENTS, SHIPPED_NAMES, STAGES, STANDBY_READY, STATUS_SCRIPT, STEPS, STEP_DOWN, amqpClientImage, basesOf, bootstrapOf, brokerEnv, buildOf, buildRecordOf, callOf, cancelsOf, cargoVersions, clockOffsetOf, closeOrExit, cloudOf, clusterArgs, clusterConf, clusterCutOf, clusterHostsOf, clusterOnce, clusterStagesOf, clusterViewOf, commitProblems, commitVoid, comparable, controllerEnv, crossingsOf, cutOf, deadlineOf, delayVoids, deviceOf, drillOnce, drillSpan, dropFinding, dropOf, endpointAfter, envOf, environmentCounts, environmentProblems, errorsOf, estimateOf, estimateVerdict, exitOf, fieldOf, fieldsOf, firstUnanswered, frrConf, goHttpImage, goVersions, groupOnce, groupVerdictOf, grpcClientImage, harnessImage, harnessRecord, harnessVersion, hashOf, highestHeld, hikariClientImage, hzOf, imageOf, imageProblems, inContext, infoOf, initiateScript, isFenceLine, isHopPlace, jarVersions, jitterOf, jitterOfLines, judge, kafkaArgs, kafkaClientImage, kafkaCutOf, kafkaOnce, kafkaPauseOnce, kafkaViewOf, lagsOf, laterMove, latestEndOf, leafLacks, leftAfter, loadOf, loadPlanOf, loadVerdict, locksOf, logNameOf, logTimeOf, manifestProblems, matches, measure, measureConntrack, measureDriver, measureGroup, measurePause, measurePorts, measureQueue, medianInterval, memAvailableOf, memberCommand, memberConfig, memberLineOf, mongoClientImage, monotonicAt, monotonicOf, namesGroup, nodeClientImage, nodeCommand, nodeHttpImage, nodeIdOf, nodeLineOf, nodeNameOf, nodesOnMonotonic, noiseOf, npmVersions, numbersOf, onMonotonic, openClusterLab, openFabric, openGroupLab, openKafkaLab, openLab, openReplicaSetLab, openStandby, pairArgs, pairOnce, pairingOf, pairingsOf, pauseReady, peersOf, pgClientImage, pingsOf, plainOf, planOf, poolOf, programLines, programOf, quantileOf, readCpu, readHost, readOplog, reconnectFinding, reconnectOf, recordProblems, recoveryFindings, recoveryOf, referenceOf, reorderingOf, replicaSetArgs, replicaSetOnce, replicaSetStagesOf, requestOf, requestWords, restamped, roomNeeded, roomVoidOf, routeLine, routerImage, routesOf, runCell, seedScript, sentinelConfig, sessionsOf, shippedClientRecord, shippedSource, sliceQuery, socketAt, socketOf, socketsOf, spread, spreadOf, stagesOf, standaloneCommand, standbyCommand, statusViewOf, stealShare, stopScript, streamsLoadOf, subjectClient, subjectProblems, subscriptionsOf, substrateHere, substrateKey, substrateOf, substrateOn, targetImageOf, targetSourceOf, templated, toolJsonOf, topicOf, topologyOf, toxicBody, unlockedManifests, unpinnedBases, unpoolable, verdictOf, versionsOf, viewOf, writesOf };
9271
+ export { AWS_FROM, CLIENT_CAPABILITIES, CLIENT_NAMES, CLOSED_TOLERANCE, CLOUDS, CLUSTER_STAGES, CONVERGE_MS, DAEMONS, DEBUG, DIRTY, DROP_HANDLING, FABRIC_CLIENT, FABRIC_DEVICE, FABRIC_TARGET, FRR_IMAGE, GIVES_AWAY, HASH_SCRIPT, INJECT, INSERT, KAFKA_TAIL_MS, KEPT, LAYERS, LINGER_MS, LISTING, LOAD_FORMAT, LOAD_PATH, LOCK_NAMES, LOSS_MARGIN, MEMBER_MARKS, MONITOR_DOWN, NODE_MARKS, NOISE, PINNED, PUMP, PUMP_SLACK, QUIET_MS, RELATIVE, REPLICA_SET_STAGES, REPOSITORY, RESTART, ROUTERS, SCHEDULE_PATH, SEED_DOCUMENT, SHIPPED_CLIENTS, SHIPPED_NAMES, STAGES, STANDBY_READY, STATUS_SCRIPT, STEPS, STEP_DOWN, amqpClientImage, basesOf, bootstrapOf, brokerEnv, buildOf, buildRecordOf, callOf, cancelsOf, cargoVersions, clockOffsetOf, closeOrExit, cloudOf, clusterArgs, clusterConf, clusterCutOf, clusterHostsOf, clusterOnce, clusterStagesOf, clusterViewOf, commitProblems, commitVoid, comparable, controllerEnv, crossingsOf, cutOf, deadlineOf, delayVoids, deliveryFinding, deliveryOf, deviceOf, drillOnce, drillSpan, dropFinding, dropOf, endpointAfter, envOf, environmentCounts, environmentProblems, errorsOf, estimateOf, estimateVerdict, exitOf, fieldOf, fieldsOf, firstUnanswered, frrConf, goHttpImage, goVersions, groupOnce, groupVerdictOf, grpcClientImage, harnessImage, harnessRecord, harnessVersion, hashOf, highestHeld, hikariClientImage, hzOf, imageOf, imageProblems, inContext, infoOf, initiateScript, isFenceLine, isHopPlace, jarVersions, jitterOf, jitterOfLines, judge, kafkaArgs, kafkaClientImage, kafkaCutOf, kafkaOnce, kafkaPauseOnce, kafkaViewOf, lagsOf, laterMove, latestEndOf, leafLacks, leftAfter, loadOf, loadPlanOf, loadVerdict, locksOf, logNameOf, logTimeOf, manifestProblems, matches, measure, measureConntrack, measureDriver, measureGroup, measurePause, measurePorts, measureQueue, medianInterval, memAvailableOf, memberCommand, memberConfig, memberLineOf, mongoClientImage, monotonicAt, monotonicOf, namesGroup, nodeClientImage, nodeCommand, nodeHttpImage, nodeIdOf, nodeLineOf, nodeNameOf, nodesOnMonotonic, noiseOf, npmVersions, numbersOf, onMonotonic, openClusterLab, openFabric, openGroupLab, openKafkaLab, openLab, openReplicaSetLab, openStandby, pairArgs, pairOnce, pairingOf, pairingsOf, pauseReady, peersOf, pgClientImage, pingsOf, plainOf, planOf, pongsOf, poolOf, programLines, programOf, quantileOf, readCpu, readHost, readOplog, reconnectFinding, reconnectOf, recordProblems, recoveryFindings, recoveryOf, referenceOf, reorderingOf, replicaSetArgs, replicaSetOnce, replicaSetStagesOf, requestOf, requestWords, restamped, roomNeeded, roomVoidOf, routeLine, routerImage, routesOf, runCell, seedScript, sentinelConfig, sessionsOf, shippedClientRecord, shippedSource, sliceQuery, socketAt, socketOf, socketsOf, spread, spreadOf, stagesOf, standaloneCommand, standbyCommand, statusViewOf, stealShare, stopScript, streamEnded, streamOf, streamsLoadOf, subjectClient, subjectProblems, subscriptionsOf, substrateHere, substrateKey, substrateOf, substrateOn, targetImageOf, targetSourceOf, templated, toolJsonOf, topicOf, topologyOf, toxicBody, unlockedManifests, unpinnedBases, unpoolable, verdictOf, versionsOf, viewOf, writesOf };
9200
9272
 
9201
9273
  //# sourceMappingURL=index.js.map