@mark1russell7/harness 0.15.8 → 0.15.10
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 +6 -1
- package/build/{image-CsPgXjcZ.js → image-D509StXX.js} +3 -2
- package/build/image-D509StXX.js.map +1 -0
- package/build/index.d.ts +7 -0
- package/build/index.js +52 -52
- package/build/index.js.map +1 -1
- package/build/schema.js +1 -1
- package/package.json +10 -3
- package/build/image-CsPgXjcZ.js.map +0 -1
package/build/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
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-
|
|
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-D509StXX.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";
|
|
5
5
|
import { closedLoopPlan, measureLoad, schedule, scheduleHeld } from "@mark1russell7/rigor-chaos";
|
|
6
|
+
import { setTimeout as setTimeout$1 } from "node:timers/promises";
|
|
6
7
|
import { createHash, randomBytes } from "node:crypto";
|
|
7
8
|
import { execFile } from "node:child_process";
|
|
8
9
|
import { mkdtemp, rm, writeFile } from "node:fs/promises";
|
|
@@ -3858,7 +3859,7 @@ const openFabric = async (parts) => {
|
|
|
3858
3859
|
}
|
|
3859
3860
|
if (lacks.length === 0) return;
|
|
3860
3861
|
if (Date.now() > deadline) throw new Error(`the fabric is not ready: ${lacks.join("; ")}`);
|
|
3861
|
-
await
|
|
3862
|
+
await setTimeout$1(READY_POLL_MS);
|
|
3862
3863
|
}
|
|
3863
3864
|
},
|
|
3864
3865
|
async sessions() {
|
|
@@ -4043,7 +4044,6 @@ const TAIL_LINES = 60;
|
|
|
4043
4044
|
const OUTPUT_LINES = 2e3;
|
|
4044
4045
|
/** This time is how long a write of a hop waits for the line that confirms it, in milliseconds. */
|
|
4045
4046
|
const CONFIRM_MS = 1e4;
|
|
4046
|
-
const sleep$6 = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
4047
4047
|
/** This function gives the arguments of the injector for the options of a fault. */
|
|
4048
4048
|
const optionArgs = (options) => [
|
|
4049
4049
|
...options.direction === void 0 ? [] : ["--direction", options.direction],
|
|
@@ -4943,7 +4943,7 @@ const openLab = async (target, kind = "tcp", topology) => {
|
|
|
4943
4943
|
};
|
|
4944
4944
|
while (!confirmed()) {
|
|
4945
4945
|
if (Date.now() - started > CONFIRM_MS) throw new Error(`the hop ${event.hop} did not confirm the write of ${event.write.path}: no line "${confirm}" in ${CONFIRM_MS / 1e3} s`);
|
|
4946
|
-
await
|
|
4946
|
+
await setTimeout$1(50);
|
|
4947
4947
|
}
|
|
4948
4948
|
}
|
|
4949
4949
|
return stamp;
|
|
@@ -5111,7 +5111,6 @@ const STOP_MS = 5e3;
|
|
|
5111
5111
|
const STANDBY_READY = "database system is ready to accept read-only connections";
|
|
5112
5112
|
/** This text is the write of the client, with its sequence number. */
|
|
5113
5113
|
const INSERT = `INSERT INTO ${TABLE} VALUES ($n)`;
|
|
5114
|
-
const sleep$5 = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
5115
5114
|
/** This function gives the argv of one statement in psql, on the server in the same container. */
|
|
5116
5115
|
const psql = (statement) => [
|
|
5117
5116
|
"psql",
|
|
@@ -5171,7 +5170,7 @@ const untilStreaming = async (lab, state) => {
|
|
|
5171
5170
|
const seen = await lab.exec(psql("SELECT sync_state FROM pg_stat_replication WHERE state = 'streaming'"));
|
|
5172
5171
|
if (seen === state) return;
|
|
5173
5172
|
if (Date.now() - started > SETUP_MS) throw new Error(`the standby did not stream as ${state} in ${SETUP_MS} ms: it reports "${seen}"`);
|
|
5174
|
-
await
|
|
5173
|
+
await setTimeout$1(100);
|
|
5175
5174
|
}
|
|
5176
5175
|
};
|
|
5177
5176
|
/**
|
|
@@ -5201,7 +5200,7 @@ const untilSteady = async (probe) => {
|
|
|
5201
5200
|
const started = Date.now();
|
|
5202
5201
|
while (probe.events.filter((event) => event.ev === "ack").length < STEADY$4) {
|
|
5203
5202
|
if (Date.now() - started > SETUP_MS) throw new Error(`the client did not write ${STEADY$4} times in ${SETUP_MS} ms`);
|
|
5204
|
-
await
|
|
5203
|
+
await setTimeout$1(10);
|
|
5205
5204
|
}
|
|
5206
5205
|
};
|
|
5207
5206
|
/** This function gives the count of lost records in the latest clock line of the prober. */
|
|
@@ -5229,11 +5228,11 @@ const pairOnce = async (lab, standby, cell, environment, index, dry = false) =>
|
|
|
5229
5228
|
fault = await lab.fault("blackhole", "target", { peers: peersOf$1(pair, standby.ip, lab) });
|
|
5230
5229
|
const started = Date.now();
|
|
5231
5230
|
for (const at of cancelsOf(pair, holdNs)) {
|
|
5232
|
-
await
|
|
5231
|
+
await setTimeout$1(Math.max(0, at / 1e6 - (Date.now() - started)));
|
|
5233
5232
|
await lab.exec(psql("SELECT count(pg_cancel_backend(pid)) FROM pg_stat_activity WHERE wait_event = 'SyncRep'"));
|
|
5234
5233
|
}
|
|
5235
5234
|
heal = await lab.signal("KILL", fault.t0 + holdNs);
|
|
5236
|
-
await
|
|
5235
|
+
await setTimeout$1(LAST_WRITE_MS);
|
|
5237
5236
|
if (cell.target.kill !== void 0) await lab.exec(cell.target.kill);
|
|
5238
5237
|
}
|
|
5239
5238
|
await probe.go().catch(() => void 0);
|
|
@@ -5317,6 +5316,12 @@ const pinProblems = (what, image, id, build, needsBuild) => {
|
|
|
5317
5316
|
return BUILD_TAG.test(image) && needsBuild ? [`${what}: the image ${image} is a build with no build record`] : [`${what}: the image ${image} has no digest`];
|
|
5318
5317
|
};
|
|
5319
5318
|
/**
|
|
5319
|
+
* This function gives each problem of one image of a run outside a manifest of the harness, as the
|
|
5320
|
+
* kind lab records its images. A pulled image needs its digest. An image that a build makes needs
|
|
5321
|
+
* its build record, with each base by digest. The build record must have the tag of the image.
|
|
5322
|
+
*/
|
|
5323
|
+
const imagePinProblems = (what, image, build) => build !== void 0 && !PINNED.test(image) && build.tag !== image ? [`${what}: the build record has the tag ${build.tag}, not the tag of the image ${image}`] : pinProblems(what, image, void 0, build, true);
|
|
5324
|
+
/**
|
|
5320
5325
|
* This function gives each problem of a manifest that stops it from pinning the programs of its
|
|
5321
5326
|
* run. An empty list means that the manifest pins each program.
|
|
5322
5327
|
* - the target: an image by its digest, or the build of a subject with its build record and its base
|
|
@@ -5472,7 +5477,6 @@ const viewOf = (group, ips, sentinels, members) => {
|
|
|
5472
5477
|
why: "healthy"
|
|
5473
5478
|
};
|
|
5474
5479
|
};
|
|
5475
|
-
const sleep$4 = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
5476
5480
|
/** This time is the longest that a group takes to converge before a run, or after it. */
|
|
5477
5481
|
const CONVERGE_MS = 24e4;
|
|
5478
5482
|
/**
|
|
@@ -5667,7 +5671,7 @@ const openGroupLab = async (group, options = {}) => {
|
|
|
5667
5671
|
}));
|
|
5668
5672
|
calm = last.healthy ? calm + 1 : 0;
|
|
5669
5673
|
if (calm >= 2 && last.primary !== null) return last.primary;
|
|
5670
|
-
await
|
|
5674
|
+
await setTimeout$1(1e3);
|
|
5671
5675
|
}
|
|
5672
5676
|
throw new Error(`the group did not converge in ${within} ms: ${last.why}`);
|
|
5673
5677
|
},
|
|
@@ -5752,7 +5756,7 @@ const openGroupLab = async (group, options = {}) => {
|
|
|
5752
5756
|
const started = Date.now();
|
|
5753
5757
|
while (await cli(member, ["PING"]).catch(() => "") !== "PONG") {
|
|
5754
5758
|
if (Date.now() - started > 3e4) throw new Error(`${member} did not start again`);
|
|
5755
|
-
await
|
|
5759
|
+
await setTimeout$1(200);
|
|
5756
5760
|
}
|
|
5757
5761
|
},
|
|
5758
5762
|
failover(coordinated) {
|
|
@@ -6003,7 +6007,7 @@ const groupOnce = async (lab, cell, environment, index) => {
|
|
|
6003
6007
|
await healed;
|
|
6004
6008
|
const after = heal?.t0 ?? t0;
|
|
6005
6009
|
return waitFor$3(client, (event) => event.ev === "ack" && event.t > after, deadline);
|
|
6006
|
-
})()) !== void 0) await
|
|
6010
|
+
})()) !== void 0) await setTimeout$1(TAIL_MS$3);
|
|
6007
6011
|
await healed;
|
|
6008
6012
|
} finally {
|
|
6009
6013
|
for (const step of undo.reverse()) await step().catch(() => void 0);
|
|
@@ -6170,7 +6174,6 @@ const statusViewOf = (set, ips, status) => {
|
|
|
6170
6174
|
};
|
|
6171
6175
|
};
|
|
6172
6176
|
/** This function waits for a time, in ms. */
|
|
6173
|
-
const sleep$3 = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
6174
6177
|
/** These are the arguments of replSetStepDown: the time that the old primary cannot stand again, and the wait for a secondary to catch up. */
|
|
6175
6178
|
const STEP_DOWN = {
|
|
6176
6179
|
seconds: 60,
|
|
@@ -6318,7 +6321,7 @@ const openReplicaSetLab = async (set, backups = false) => {
|
|
|
6318
6321
|
calm = last.healthy ? calm + 1 : 0;
|
|
6319
6322
|
if (last.primary !== null) known = last.primary;
|
|
6320
6323
|
if (calm >= 2 && last.primary !== null) return last.primary;
|
|
6321
|
-
await
|
|
6324
|
+
await setTimeout$1(1e3);
|
|
6322
6325
|
}
|
|
6323
6326
|
throw new Error(`the set did not converge in ${within} ms: ${last.why}`);
|
|
6324
6327
|
};
|
|
@@ -6424,7 +6427,7 @@ const openReplicaSetLab = async (set, backups = false) => {
|
|
|
6424
6427
|
const started = Date.now();
|
|
6425
6428
|
while (!(await shell(member, "print(db.hello().ok)").catch(() => "")).includes("1")) {
|
|
6426
6429
|
if (Date.now() - started > 6e4) throw new Error(`${member} did not start again`);
|
|
6427
|
-
await
|
|
6430
|
+
await setTimeout$1(500);
|
|
6428
6431
|
}
|
|
6429
6432
|
},
|
|
6430
6433
|
exec(member, argv) {
|
|
@@ -6646,10 +6649,10 @@ const replicaSetOnce = async (lab, cell, environment, index) => {
|
|
|
6646
6649
|
const t1 = fault.t1;
|
|
6647
6650
|
const old = `${lab.members[primary].ip}:${set.port}`;
|
|
6648
6651
|
const sentAt = (n) => client.events.find((event) => event.ev === "sent" && Number(event["n"]) === n)?.t ?? -Infinity;
|
|
6649
|
-
if (await waitFor$2(client, (event) => event.ev === "ack" && sentAt(Number(event["n"])) > t1 && (lands === "same" || typeof event["at"] === "string" && event["at"] !== old), deadlineOf(cell)) !== void 0) await
|
|
6652
|
+
if (await waitFor$2(client, (event) => event.ev === "ack" && sentAt(Number(event["n"])) > t1 && (lands === "same" || typeof event["at"] === "string" && event["at"] !== old), deadlineOf(cell)) !== void 0) await setTimeout$1(TAIL_MS$2);
|
|
6650
6653
|
if (healing !== null) {
|
|
6651
6654
|
await healed.catch(() => void 0);
|
|
6652
|
-
await
|
|
6655
|
+
await setTimeout$1(afterLiftOf(cell));
|
|
6653
6656
|
}
|
|
6654
6657
|
} finally {
|
|
6655
6658
|
for (const step of undo.reverse()) await step().catch(() => void 0);
|
|
@@ -6706,7 +6709,7 @@ const until = async (what, check, within) => {
|
|
|
6706
6709
|
const started = Date.now();
|
|
6707
6710
|
while (!await check().catch(() => false)) {
|
|
6708
6711
|
if (Date.now() - started > within) throw new Error(`${what} did not come in ${within} ms`);
|
|
6709
|
-
await
|
|
6712
|
+
await setTimeout$1(500);
|
|
6710
6713
|
}
|
|
6711
6714
|
};
|
|
6712
6715
|
/** This function gives the time that the client sent a write. Zero is no write. */
|
|
@@ -6793,7 +6796,7 @@ const backupsOf = async (lab, drill, primary, writer) => {
|
|
|
6793
6796
|
}];
|
|
6794
6797
|
const every = valueIn(drill.sliceEvery, "s") * 1e3;
|
|
6795
6798
|
for (let slice = 1; slice <= drill.slices; slice += 1) {
|
|
6796
|
-
await
|
|
6799
|
+
await setTimeout$1(Math.max(0, ended + slice * every - Date.now()));
|
|
6797
6800
|
const out = `${VAULT}/slice-${slice}`;
|
|
6798
6801
|
const begun = Date.now();
|
|
6799
6802
|
await lab.vault([
|
|
@@ -6837,7 +6840,7 @@ const lose = async (lab, drill, primary, last) => {
|
|
|
6837
6840
|
const parts = drill.recovery === "restore" ? [primary, ...lab.set.members.filter((name) => name !== primary)] : [primary];
|
|
6838
6841
|
const age = valueIn(drill.age, "s");
|
|
6839
6842
|
const at = last === null || drill.quiet === true ? void 0 : last.t + age * 1e9;
|
|
6840
|
-
if (at === void 0) await
|
|
6843
|
+
if (at === void 0) await setTimeout$1(age * 1e3);
|
|
6841
6844
|
const stamps = await Promise.all(parts.map((part) => lab.signal(part, "KILL", at)));
|
|
6842
6845
|
for (const part of parts) {
|
|
6843
6846
|
await lab.exec(part, [
|
|
@@ -6982,11 +6985,11 @@ const drillOnce = async (lab, cell, environment, index) => {
|
|
|
6982
6985
|
"--from",
|
|
6983
6986
|
String(second)
|
|
6984
6987
|
]);
|
|
6985
|
-
if (await waitFor$2(successor, (event) => event.ev === "ack", deadlineOf(cell)) !== void 0) await
|
|
6988
|
+
if (await waitFor$2(successor, (event) => event.ev === "ack", deadlineOf(cell)) !== void 0) await setTimeout$1(TAIL_MS$2);
|
|
6986
6989
|
} else {
|
|
6987
6990
|
const old = `${lab.members[primary].ip}:${set.port}`;
|
|
6988
6991
|
const sentAt = (n) => writer.events.find((event) => event.ev === "sent" && Number(event["n"]) === n)?.t ?? -Infinity;
|
|
6989
|
-
if (await waitFor$2(writer, (event) => event.ev === "ack" && sentAt(Number(event["n"])) > stamp.t1 && typeof event["at"] === "string" && event["at"] !== old, deadlineOf(cell)) !== void 0) await
|
|
6992
|
+
if (await waitFor$2(writer, (event) => event.ev === "ack" && sentAt(Number(event["n"])) > stamp.t1 && typeof event["at"] === "string" && event["at"] !== old, deadlineOf(cell)) !== void 0) await setTimeout$1(TAIL_MS$2);
|
|
6990
6993
|
await lab.restart(primary);
|
|
6991
6994
|
}
|
|
6992
6995
|
} finally {
|
|
@@ -7165,7 +7168,6 @@ const clusterCutOf = (cluster, members, client, part, cuts) => {
|
|
|
7165
7168
|
};
|
|
7166
7169
|
return { peers: [...others, client] };
|
|
7167
7170
|
};
|
|
7168
|
-
const sleep$2 = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
7169
7171
|
/**
|
|
7170
7172
|
* This function opens one environment of a cluster cell:
|
|
7171
7173
|
* - one new network, with each node, the client and the admin on it.
|
|
@@ -7327,7 +7329,7 @@ const openClusterLab = async (cluster) => {
|
|
|
7327
7329
|
calm = last.healthy ? calm + 1 : 0;
|
|
7328
7330
|
if (last.primary !== null) known = last.primary;
|
|
7329
7331
|
if (calm >= 2 && last.primary !== null) return last.primary;
|
|
7330
|
-
await
|
|
7332
|
+
await setTimeout$1(1e3);
|
|
7331
7333
|
}
|
|
7332
7334
|
throw new Error(`the queue did not converge in ${within} ms: ${last.why}`);
|
|
7333
7335
|
};
|
|
@@ -7343,7 +7345,7 @@ const openClusterLab = async (cluster) => {
|
|
|
7343
7345
|
const running = (text.trim() === "" ? {} : toolJsonOf(text)).running_nodes ?? [];
|
|
7344
7346
|
if (cluster.members.every((name) => running.includes(nodeNameOf(name)))) break;
|
|
7345
7347
|
if (Date.now() - started > 12e4) throw new Error(`the cluster did not form in 120 s: ${running.join(", ")} run`);
|
|
7346
|
-
await
|
|
7348
|
+
await setTimeout$1(1e3);
|
|
7347
7349
|
}
|
|
7348
7350
|
const declared = lastLine(await output(commander, [
|
|
7349
7351
|
"node",
|
|
@@ -7463,7 +7465,7 @@ const openClusterLab = async (cluster) => {
|
|
|
7463
7465
|
"check_running"
|
|
7464
7466
|
]).then(() => true).catch(() => false)) {
|
|
7465
7467
|
if (Date.now() - begun > 12e4) throw new Error(`${member} did not start again`);
|
|
7466
|
-
await
|
|
7468
|
+
await setTimeout$1(1e3);
|
|
7467
7469
|
}
|
|
7468
7470
|
},
|
|
7469
7471
|
stepDown(leader, to) {
|
|
@@ -7634,7 +7636,7 @@ const stampOf = async (lab, client, logFrom, marks, wall) => {
|
|
|
7634
7636
|
},
|
|
7635
7637
|
line
|
|
7636
7638
|
};
|
|
7637
|
-
await
|
|
7639
|
+
await setTimeout$1(100);
|
|
7638
7640
|
}
|
|
7639
7641
|
return {
|
|
7640
7642
|
stamp: monotonicOf(wall, client.events),
|
|
@@ -7736,10 +7738,10 @@ const clusterOnce = async (lab, cell, environment, index) => {
|
|
|
7736
7738
|
healed.catch(() => void 0);
|
|
7737
7739
|
const t1 = fault.t1;
|
|
7738
7740
|
const sentAt = (n) => client.events.find((event) => event.ev === "sent" && Number(event["n"]) === n)?.t ?? -Infinity;
|
|
7739
|
-
if (await waitFor$1(client, (event) => event.ev === "ack" && sentAt(Number(event["n"])) > t1, deadlineOf(cell)) !== void 0) await
|
|
7741
|
+
if (await waitFor$1(client, (event) => event.ev === "ack" && sentAt(Number(event["n"])) > t1, deadlineOf(cell)) !== void 0) await setTimeout$1(TAIL_MS$1);
|
|
7740
7742
|
if (healing !== null) {
|
|
7741
7743
|
await healed.catch(() => void 0);
|
|
7742
|
-
await
|
|
7744
|
+
await setTimeout$1(TAIL_MS$1);
|
|
7743
7745
|
}
|
|
7744
7746
|
} finally {
|
|
7745
7747
|
for (const step of undo.reverse()) await step().catch(() => void 0);
|
|
@@ -7883,7 +7885,6 @@ const kafkaCutOf = (kafka, members, controller, part, cuts) => {
|
|
|
7883
7885
|
const bootstrapOf = (kafka) => kafka.brokers.map((name) => `${name}:${kafka.port}`).join(",");
|
|
7884
7886
|
/** This function gives the name of the topic of a run. A warm-up has the index -1. */
|
|
7885
7887
|
const topicOf = (environment, index) => `cells-e${environment}-r${index + 1}`;
|
|
7886
|
-
const sleep$1 = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
7887
7888
|
/**
|
|
7888
7889
|
* This function opens one environment of a Kafka cell:
|
|
7889
7890
|
* - one new network, with each node, the client and the commander on it.
|
|
@@ -8023,7 +8024,7 @@ const openKafkaLab = async (kafka) => {
|
|
|
8023
8024
|
const read = await view().catch((error) => error.message.slice(0, 200));
|
|
8024
8025
|
if (typeof read !== "string" && read.brokers.length === kafka.brokers.length) return;
|
|
8025
8026
|
last = typeof read === "string" ? read : `${read.brokers.length} brokers are not fenced`;
|
|
8026
|
-
await
|
|
8027
|
+
await setTimeout$1(1e3);
|
|
8027
8028
|
}
|
|
8028
8029
|
throw new Error(`the brokers did not come up in ${within} ms: ${last}`);
|
|
8029
8030
|
},
|
|
@@ -8083,7 +8084,7 @@ const openKafkaLab = async (kafka) => {
|
|
|
8083
8084
|
}));
|
|
8084
8085
|
calm = last.healthy ? calm + 1 : 0;
|
|
8085
8086
|
if (calm >= 2 && last.primary !== null) return last.primary;
|
|
8086
|
-
await
|
|
8087
|
+
await setTimeout$1(1e3);
|
|
8087
8088
|
}
|
|
8088
8089
|
throw new Error(`the partition did not converge in ${within} ms: ${last.why}`);
|
|
8089
8090
|
},
|
|
@@ -8286,7 +8287,7 @@ const kafkaOnce = async (lab, cell, environment, index) => {
|
|
|
8286
8287
|
undo.push(() => lab.lift("blackhole", leader, cuts));
|
|
8287
8288
|
heal = await lab.lift("blackhole", leader, cuts, fault.t0 + valueIn(cell.hold, "s") * 1e9);
|
|
8288
8289
|
undo.length = 0;
|
|
8289
|
-
await
|
|
8290
|
+
await setTimeout$1(KAFKA_TAIL_MS);
|
|
8290
8291
|
} finally {
|
|
8291
8292
|
for (const step of undo.reverse()) await step().catch(() => void 0);
|
|
8292
8293
|
await client.stop();
|
|
@@ -8384,14 +8385,14 @@ const kafkaPauseOnce = async (lab, cell, environment, index) => {
|
|
|
8384
8385
|
firstEvents = first.events;
|
|
8385
8386
|
otherEvents = other.events;
|
|
8386
8387
|
const begun = Date.now();
|
|
8387
|
-
while (Date.now() - begun < PAUSE_READY_MS && !pauseReady(first.events, other.events)) await
|
|
8388
|
+
while (Date.now() - begun < PAUSE_READY_MS && !pauseReady(first.events, other.events)) await setTimeout$1(100);
|
|
8388
8389
|
if (pauseReady(first.events, other.events)) {
|
|
8389
8390
|
const seen = first.events.at(-1)?.t ?? 0;
|
|
8390
8391
|
const batch = await waitFor(first, (event) => event.ev === "processing" && event.t > seen, PAUSE_BATCH_MS);
|
|
8391
8392
|
if (batch !== void 0) {
|
|
8392
8393
|
fault = await first.signal("STOP", batch.t + valueIn(pause.stopAfter, "s") * 1e9);
|
|
8393
8394
|
heal = await first.signal("CONT", fault.t0 + hold * 1e9);
|
|
8394
|
-
await
|
|
8395
|
+
await setTimeout$1(KAFKA_TAIL_MS);
|
|
8395
8396
|
}
|
|
8396
8397
|
}
|
|
8397
8398
|
} finally {
|
|
@@ -8538,7 +8539,6 @@ const observerError = (cell, partial, within, dropped = () => false) => new Prom
|
|
|
8538
8539
|
};
|
|
8539
8540
|
look();
|
|
8540
8541
|
});
|
|
8541
|
-
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
8542
8542
|
/**
|
|
8543
8543
|
* This time is the pause between the client's first reply and the fault. It is more than Linux's
|
|
8544
8544
|
* TCP_DELACK_MAX of 200 ms. Thus the delayed ACK of the reply is out before the fault.
|
|
@@ -8578,7 +8578,7 @@ const driverOutcome = async (cell, current, within) => {
|
|
|
8578
8578
|
const started = Date.now();
|
|
8579
8579
|
while (Date.now() - started < within) {
|
|
8580
8580
|
if (settled(cell, current())) return;
|
|
8581
|
-
await
|
|
8581
|
+
await setTimeout$1(250);
|
|
8582
8582
|
}
|
|
8583
8583
|
};
|
|
8584
8584
|
/** This function gives the longest wait of a run of a driver cell for its outcome, in ms. */
|
|
@@ -8614,7 +8614,7 @@ const beforeOnce = async (lab, cell, environment, index) => {
|
|
|
8614
8614
|
...lab.topology === null ? {} : { topology: lab.topology }
|
|
8615
8615
|
});
|
|
8616
8616
|
await driverOutcome(cell, current, driverWithin(cell));
|
|
8617
|
-
await
|
|
8617
|
+
await setTimeout$1(TAIL_MS);
|
|
8618
8618
|
} finally {
|
|
8619
8619
|
await lab.lift(kind, faultAt, options);
|
|
8620
8620
|
await probe?.stop();
|
|
@@ -8670,8 +8670,8 @@ const LINES_MS = 5e3;
|
|
|
8670
8670
|
const linesCounted = async (lab, from, counts) => {
|
|
8671
8671
|
const started = Date.now();
|
|
8672
8672
|
const short = () => counts.some((each) => countOf(lab.server.slice(from), each.match) < each.count);
|
|
8673
|
-
while (short() && Date.now() - started < LINES_MS) await
|
|
8674
|
-
await
|
|
8673
|
+
while (short() && Date.now() - started < LINES_MS) await setTimeout$1(20);
|
|
8674
|
+
await setTimeout$1(250);
|
|
8675
8675
|
};
|
|
8676
8676
|
/** This function gives the netem specification of a cell: its latency, then the netem of its fault when it has one. */
|
|
8677
8677
|
const netemSpec = (cell, fault) => {
|
|
@@ -8752,13 +8752,13 @@ const once = async (lab, cell, environment, index, dry = false) => {
|
|
|
8752
8752
|
await probe.until(["ready"], 15e3);
|
|
8753
8753
|
if (dry) {
|
|
8754
8754
|
if (cell.probe.mode !== "idle") await go();
|
|
8755
|
-
await
|
|
8755
|
+
await setTimeout$1(500);
|
|
8756
8756
|
} else {
|
|
8757
8757
|
const replyInFlight = cell.probe.mode === "inflight" && (server && cell.fault !== "mtu-blackhole" || cell.fault === "fin" || requestFirst(cell));
|
|
8758
8758
|
if (replyInFlight) {
|
|
8759
8759
|
await go();
|
|
8760
|
-
await
|
|
8761
|
-
} else await
|
|
8760
|
+
await setTimeout$1(200);
|
|
8761
|
+
} else await setTimeout$1(250);
|
|
8762
8762
|
const faultAt = cell.faultAt ?? (server ? "client" : "target");
|
|
8763
8763
|
const towardServerComesIn = faultAt === "target" || isHopPlace(faultAt) && faultAt.toward === "client";
|
|
8764
8764
|
const direction = cell.drops === void 0 ? void 0 : cell.drops === "to-server" === towardServerComesIn ? "in" : "out";
|
|
@@ -8873,7 +8873,7 @@ const once = async (lab, cell, environment, index, dry = false) => {
|
|
|
8873
8873
|
};
|
|
8874
8874
|
fault = await apply();
|
|
8875
8875
|
try {
|
|
8876
|
-
if (cell.idleBefore !== void 0 && cell.probe.mode !== "idle") await
|
|
8876
|
+
if (cell.idleBefore !== void 0 && cell.probe.mode !== "idle") await setTimeout$1(valueIn(cell.idleBefore, "ms"));
|
|
8877
8877
|
if ((cell.probe.mode === "inflight" || cell.probe.mode === "stream" || cell.probe.mode === "schedule") && !replyInFlight) await go();
|
|
8878
8878
|
const { prediction } = cell;
|
|
8879
8879
|
const http = cell.probe.http !== void 0;
|
|
@@ -8882,8 +8882,8 @@ const once = async (lab, cell, environment, index, dry = false) => {
|
|
|
8882
8882
|
...partial(),
|
|
8883
8883
|
fault
|
|
8884
8884
|
}), driverWithin(cell));
|
|
8885
|
-
else await
|
|
8886
|
-
await
|
|
8885
|
+
else await setTimeout$1(valueIn(prediction.window, "s") * 1e3);
|
|
8886
|
+
await setTimeout$1(TAIL_MS);
|
|
8887
8887
|
} else if (cell.probe.mode === "gap") {
|
|
8888
8888
|
const gap = cell.probe.http?.gap === void 0 ? 0 : valueIn(cell.probe.http.gap, "s");
|
|
8889
8889
|
const window = valueIn(prediction.detects ? prediction.high : prediction.window, "s");
|
|
@@ -8909,7 +8909,7 @@ const once = async (lab, cell, environment, index, dry = false) => {
|
|
|
8909
8909
|
"eof",
|
|
8910
8910
|
"drop"
|
|
8911
8911
|
], window * 1e3).catch(() => void 0);
|
|
8912
|
-
await
|
|
8912
|
+
await setTimeout$1(MONITOR_MS);
|
|
8913
8913
|
const moved = laterMove(fabricOf().routes.slice(routesFrom), fault?.t0 ?? 0);
|
|
8914
8914
|
heal = moved === null ? null : {
|
|
8915
8915
|
t0: moved,
|
|
@@ -8934,7 +8934,7 @@ const once = async (lab, cell, environment, index, dry = false) => {
|
|
|
8934
8934
|
"drop",
|
|
8935
8935
|
...http ? ["closed"] : []
|
|
8936
8936
|
], within).catch(() => void 0);
|
|
8937
|
-
} else await
|
|
8937
|
+
} else await setTimeout$1(valueIn(prediction.window, "s") * 1e3);
|
|
8938
8938
|
} finally {
|
|
8939
8939
|
await lift();
|
|
8940
8940
|
if (toxicFirst) await lab.toxic(null);
|
|
@@ -8954,8 +8954,8 @@ const once = async (lab, cell, environment, index, dry = false) => {
|
|
|
8954
8954
|
...partial(),
|
|
8955
8955
|
server: lab.server.slice(serverFrom)
|
|
8956
8956
|
});
|
|
8957
|
-
while (!streamEnded(current(), stream) && !stopped() && Date.now() - started < within) await
|
|
8958
|
-
await
|
|
8957
|
+
while (!streamEnded(current(), stream) && !stopped() && Date.now() - started < within) await setTimeout$1(20);
|
|
8958
|
+
await setTimeout$1(TAIL_MS);
|
|
8959
8959
|
}
|
|
8960
8960
|
}
|
|
8961
8961
|
} finally {
|
|
@@ -9268,6 +9268,6 @@ const runCell = async (cell, say = () => {}) => {
|
|
|
9268
9268
|
target = larger;
|
|
9269
9269
|
}
|
|
9270
9270
|
};
|
|
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 };
|
|
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, imagePinProblems, 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 };
|
|
9272
9272
|
|
|
9273
9273
|
//# sourceMappingURL=index.js.map
|