@mark1russell7/service 0.8.18 → 0.8.20
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 +19 -0
- package/build/backoff.d.ts +44 -2
- package/build/{builder-zO48Vgoj.d.ts → builder.d.ts} +14 -101
- package/build/builder.js +499 -0
- package/build/builder.js.map +1 -0
- package/build/{call-context-DDhcVvn5.d.ts → call-context.d.ts} +3 -4
- package/build/channel.d.ts +1 -1
- package/build/{core-BSzt4RI2.d.ts → client/core.d.ts} +32 -61
- package/build/{machine-BhVeHr_m.js → client/core.js} +4 -153
- package/build/client/core.js.map +1 -0
- package/build/{dial-ChwIcvd4.d.ts → client/dial.d.ts} +3 -4
- package/build/client/dial.js +52 -0
- package/build/client/dial.js.map +1 -0
- package/build/client/machine.js +29 -0
- package/build/client/machine.js.map +1 -0
- package/build/client/meets.d.ts +35 -0
- package/build/client/meets.js +78 -0
- package/build/client/meets.js.map +1 -0
- package/build/clock.d.ts +1 -1
- package/build/conformance.d.ts +122 -0
- package/build/conformance.js +470 -0
- package/build/conformance.js.map +1 -0
- package/build/contract.d.ts +28 -0
- package/build/contract.js +184 -0
- package/build/contract.js.map +1 -0
- package/build/description.d.ts +161 -0
- package/build/description.js +11 -0
- package/build/description.js.map +1 -0
- package/build/drains.js +35 -0
- package/build/drains.js.map +1 -0
- package/build/events.d.ts +25 -0
- package/build/fakes.d.ts +43 -0
- package/build/fakes.js +93 -0
- package/build/fakes.js.map +1 -0
- package/build/grpc/client.d.ts +153 -0
- package/build/grpc/client.js +474 -0
- package/build/grpc/client.js.map +1 -0
- package/build/grpc/connection.d.ts +97 -0
- package/build/grpc/connection.js +59 -0
- package/build/grpc/connection.js.map +1 -0
- package/build/grpc/machine.d.ts +12 -0
- package/build/grpc/machine.js +149 -0
- package/build/grpc/machine.js.map +1 -0
- package/build/grpc/meets.d.ts +14 -0
- package/build/grpc/meets.js +105 -0
- package/build/grpc/meets.js.map +1 -0
- package/build/grpc/starting.d.ts +33 -0
- package/build/grpc/starting.js +89 -0
- package/build/grpc/starting.js.map +1 -0
- package/build/grpc.d.ts +9 -303
- package/build/grpc.js +7 -854
- package/build/health.d.ts +93 -0
- package/build/health.js +223 -0
- package/build/health.js.map +1 -0
- package/build/heartbeat.d.ts +1 -1
- package/build/host/discovery.d.ts +61 -0
- package/build/host/discovery.js +113 -0
- package/build/host/discovery.js.map +1 -0
- package/build/host/env.d.ts +14 -0
- package/build/host/env.js +57 -0
- package/build/host/env.js.map +1 -0
- package/build/host/fakes.d.ts +82 -0
- package/build/host/fakes.js +239 -0
- package/build/host/fakes.js.map +1 -0
- package/build/host/group.d.ts +142 -0
- package/build/host/group.js +517 -0
- package/build/host/group.js.map +1 -0
- package/build/host/install.d.ts +96 -0
- package/build/host/install.js +330 -0
- package/build/host/install.js.map +1 -0
- package/build/host/lock.d.ts +78 -0
- package/build/host/lock.js +190 -0
- package/build/host/lock.js.map +1 -0
- package/build/host/logs.d.ts +26 -0
- package/build/host/logs.js +48 -0
- package/build/host/logs.js.map +1 -0
- package/build/host/node.d.ts +14 -0
- package/build/host/node.js +309 -0
- package/build/host/node.js.map +1 -0
- package/build/{ports-B1ayTL-j.d.ts → host/ports.d.ts} +15 -16
- package/build/host/ports.js +17 -0
- package/build/host/ports.js.map +1 -0
- package/build/host/probes.d.ts +51 -0
- package/build/host/probes.js +139 -0
- package/build/host/probes.js.map +1 -0
- package/build/host/processes.d.ts +32 -0
- package/build/host/processes.js +63 -0
- package/build/host/processes.js.map +1 -0
- package/build/host/render.d.ts +84 -0
- package/build/host/render.js +235 -0
- package/build/host/render.js.map +1 -0
- package/build/host/watch.d.ts +90 -0
- package/build/host/watch.js +165 -0
- package/build/host/watch.js.map +1 -0
- package/build/host.d.ts +13 -671
- package/build/host.js +12 -2126
- package/build/http/answers.js +29 -0
- package/build/http/answers.js.map +1 -0
- package/build/http/fake-server.js +61 -0
- package/build/http/fake-server.js.map +1 -0
- package/build/http/outcome.d.ts +115 -0
- package/build/http/outcome.js +325 -0
- package/build/http/outcome.js.map +1 -0
- package/build/http/probes.d.ts +83 -0
- package/build/http/probes.js +232 -0
- package/build/http/probes.js.map +1 -0
- package/build/http/transport.d.ts +165 -0
- package/build/http/transport.js +517 -0
- package/build/http/transport.js.map +1 -0
- package/build/http-client/client.d.ts +121 -0
- package/build/http-client/client.js +330 -0
- package/build/http-client/client.js.map +1 -0
- package/build/http-client/connection.d.ts +78 -0
- package/build/http-client/connection.js +54 -0
- package/build/http-client/connection.js.map +1 -0
- package/build/http-client/machine.d.ts +14 -0
- package/build/http-client/machine.js +109 -0
- package/build/http-client/machine.js.map +1 -0
- package/build/http-client/meets.d.ts +11 -0
- package/build/http-client/meets.js +74 -0
- package/build/http-client/meets.js.map +1 -0
- package/build/http-client/session.d.ts +87 -0
- package/build/http-client/session.js +99 -0
- package/build/http-client/session.js.map +1 -0
- package/build/http-client/starting.d.ts +25 -0
- package/build/http-client/starting.js +65 -0
- package/build/http-client/starting.js.map +1 -0
- package/build/http-client.d.ts +9 -330
- package/build/http-client.js +8 -707
- package/build/http.d.ts +5 -353
- package/build/http.js +3 -1086
- package/build/identity.d.ts +16 -0
- package/build/identity.js +44 -0
- package/build/identity.js.map +1 -0
- package/build/index.d.ts +35 -412
- package/build/index.js +24 -3277
- package/build/knobs.d.ts +1 -0
- package/build/{knobs-BJcz6m01.js → knobs.js} +2 -34
- package/build/knobs.js.map +1 -0
- package/build/latch.d.ts +29 -0
- package/build/latch.js +122 -0
- package/build/latch.js.map +1 -0
- package/build/{rules-HyFCBStQ.d.ts → law.d.ts} +19 -37
- package/build/law.js +149 -0
- package/build/law.js.map +1 -0
- package/build/lifecycle.d.ts +144 -0
- package/build/lifecycle.js +411 -0
- package/build/lifecycle.js.map +1 -0
- package/build/limiter/machine.d.ts +40 -0
- package/build/limiter/machine.js +279 -0
- package/build/limiter/machine.js.map +1 -0
- package/build/{policy-CBcK2XGg.d.ts → limiter/policy.d.ts} +28 -29
- package/build/{policy-UYALkqVq.js → limiter/policy.js} +10 -9
- package/build/limiter/policy.js.map +1 -0
- package/build/{limiter-Cm8nC-Gd.d.ts → limiter/quota.d.ts} +50 -76
- package/build/{limiter-Bgy6Gmvl.js → limiter/quota.js} +32 -425
- package/build/limiter/quota.js.map +1 -0
- package/build/{store-DFwFKrsB.d.ts → limiter/store.d.ts} +10 -11
- package/build/limiter/store.js +145 -0
- package/build/limiter/store.js.map +1 -0
- package/build/limiter.d.ts +4 -3
- package/build/limiter.js +4 -2
- package/build/lint.d.ts +152 -0
- package/build/lint.js +576 -0
- package/build/lint.js.map +1 -0
- package/build/logger.d.ts +71 -0
- package/build/logger.js +183 -0
- package/build/logger.js.map +1 -0
- package/build/machines.d.ts +41 -0
- package/build/machines.js +451 -0
- package/build/machines.js.map +1 -0
- package/build/metrics.d.ts +53 -0
- package/build/metrics.js +111 -0
- package/build/metrics.js.map +1 -0
- package/build/mongodb/client.d.ts +131 -0
- package/build/mongodb/client.js +388 -0
- package/build/mongodb/client.js.map +1 -0
- package/build/mongodb/connection.d.ts +112 -0
- package/build/mongodb/connection.js +12 -0
- package/build/mongodb/connection.js.map +1 -0
- package/build/mongodb/machine.d.ts +14 -0
- package/build/mongodb/machine.js +122 -0
- package/build/mongodb/machine.js.map +1 -0
- package/build/mongodb/meets.d.ts +15 -0
- package/build/mongodb/meets.js +103 -0
- package/build/mongodb/meets.js.map +1 -0
- package/build/mongodb/starting.d.ts +29 -0
- package/build/mongodb/starting.js +77 -0
- package/build/mongodb/starting.js.map +1 -0
- package/build/mongodb.d.ts +8 -296
- package/build/mongodb.js +7 -682
- package/build/operation.d.ts +27 -0
- package/build/{operation-DF73RZOI.js → operation.js} +2 -2
- package/build/operation.js.map +1 -0
- package/build/otel.d.ts +2 -2
- package/build/pg/client.d.ts +96 -0
- package/build/pg/client.js +277 -0
- package/build/pg/client.js.map +1 -0
- package/build/pg/connection.d.ts +75 -0
- package/build/pg/connection.js +11 -0
- package/build/pg/connection.js.map +1 -0
- package/build/pg/machine.d.ts +13 -0
- package/build/pg/machine.js +111 -0
- package/build/pg/machine.js.map +1 -0
- package/build/pg/meets.d.ts +14 -0
- package/build/pg/meets.js +83 -0
- package/build/pg/meets.js.map +1 -0
- package/build/pg/starting.d.ts +26 -0
- package/build/pg/starting.js +62 -0
- package/build/pg/starting.js.map +1 -0
- package/build/pg.d.ts +8 -219
- package/build/pg.js +7 -525
- package/build/poller.d.ts +9 -0
- package/build/poller.js +152 -0
- package/build/poller.js.map +1 -0
- package/build/process.d.ts +114 -0
- package/build/process.js +170 -0
- package/build/process.js.map +1 -0
- package/build/profiles.d.ts +68 -0
- package/build/profiles.js +120 -0
- package/build/profiles.js.map +1 -0
- package/build/{queue-DXdw1vLO.d.ts → queue.d.ts} +16 -29
- package/build/queue.js +279 -0
- package/build/queue.js.map +1 -0
- package/build/rabbitmq/client.d.ts +144 -0
- package/build/rabbitmq/client.js +426 -0
- package/build/rabbitmq/client.js.map +1 -0
- package/build/rabbitmq/connection.d.ts +91 -0
- package/build/rabbitmq/connection.js +15 -0
- package/build/rabbitmq/connection.js.map +1 -0
- package/build/rabbitmq/machine.d.ts +13 -0
- package/build/rabbitmq/machine.js +159 -0
- package/build/rabbitmq/machine.js.map +1 -0
- package/build/rabbitmq/meets.d.ts +12 -0
- package/build/rabbitmq/meets.js +96 -0
- package/build/rabbitmq/meets.js.map +1 -0
- package/build/rabbitmq/starting.d.ts +27 -0
- package/build/rabbitmq/starting.js +67 -0
- package/build/rabbitmq/starting.js.map +1 -0
- package/build/rabbitmq.d.ts +8 -283
- package/build/rabbitmq.js +7 -742
- package/build/redis/client.d.ts +86 -0
- package/build/redis/client.js +285 -0
- package/build/redis/client.js.map +1 -0
- package/build/redis/connection.d.ts +57 -0
- package/build/redis/connection.js +11 -0
- package/build/redis/connection.js.map +1 -0
- package/build/redis/limiter.d.ts +43 -0
- package/build/redis/limiter.js +164 -0
- package/build/redis/limiter.js.map +1 -0
- package/build/redis/machine.d.ts +12 -0
- package/build/redis/machine.js +144 -0
- package/build/redis/machine.js.map +1 -0
- package/build/redis/meets.d.ts +11 -0
- package/build/redis/meets.js +75 -0
- package/build/redis/meets.js.map +1 -0
- package/build/redis/operations.d.ts +5 -0
- package/build/redis/operations.js +114 -0
- package/build/redis/operations.js.map +1 -0
- package/build/redis.d.ts +10 -207
- package/build/redis.js +9 -771
- package/build/requests.d.ts +66 -0
- package/build/requests.js +279 -0
- package/build/requests.js.map +1 -0
- package/build/retrier.d.ts +62 -0
- package/build/{retrier-Dnjhvxol.js → retrier.js} +2 -2
- package/build/retrier.js.map +1 -0
- package/build/routes.d.ts +35 -0
- package/build/routes.js +77 -0
- package/build/routes.js.map +1 -0
- package/build/rules.d.ts +19 -2
- package/build/stops.d.ts +51 -0
- package/build/stops.js +86 -0
- package/build/stops.js.map +1 -0
- package/build/testing.d.ts +8 -270
- package/build/testing.js +4 -1027
- package/build/testing.js.map +1 -1
- package/build/timing.d.ts +63 -0
- package/build/{timing-DZl36uXs.js → timing.js} +2 -2
- package/build/timing.js.map +1 -0
- package/build/units.d.ts +17 -0
- package/build/units.js +236 -0
- package/build/units.js.map +1 -0
- package/build/watchdog.d.ts +34 -0
- package/build/watchdog.js +53 -0
- package/build/watchdog.js.map +1 -0
- package/build/websocket/client.d.ts +136 -0
- package/build/websocket/client.js +422 -0
- package/build/websocket/client.js.map +1 -0
- package/build/websocket/connection.d.ts +83 -0
- package/build/websocket/connection.js +57 -0
- package/build/websocket/connection.js.map +1 -0
- package/build/websocket/machine.d.ts +12 -0
- package/build/websocket/machine.js +155 -0
- package/build/websocket/machine.js.map +1 -0
- package/build/websocket/meets.d.ts +14 -0
- package/build/websocket/meets.js +92 -0
- package/build/websocket/meets.js.map +1 -0
- package/build/websocket/starting.d.ts +25 -0
- package/build/websocket/starting.js +69 -0
- package/build/websocket/starting.js.map +1 -0
- package/build/websocket.d.ts +9 -264
- package/build/websocket.js +8 -774
- package/build/worker.d.ts +92 -0
- package/build/worker.js +153 -0
- package/build/worker.js.map +1 -0
- package/package.json +4 -3
- package/build/backoff-QTRGfkEK.d.ts +0 -45
- package/build/clock-DpVgpY4h.d.ts +0 -2
- package/build/grpc.js.map +0 -1
- package/build/host.js.map +0 -1
- package/build/http-client.js.map +0 -1
- package/build/http.js.map +0 -1
- package/build/index.js.map +0 -1
- package/build/knobs-BJcz6m01.js.map +0 -1
- package/build/lifecycle-D0J-zwZF.d.ts +0 -374
- package/build/limiter-Bgy6Gmvl.js.map +0 -1
- package/build/logger-B6drv9w0.d.ts +0 -488
- package/build/machine-BhVeHr_m.js.map +0 -1
- package/build/mongodb.js.map +0 -1
- package/build/operation-DF73RZOI.js.map +0 -1
- package/build/pg.js.map +0 -1
- package/build/policy-UYALkqVq.js.map +0 -1
- package/build/process-7R9M29wN.js +0 -437
- package/build/process-7R9M29wN.js.map +0 -1
- package/build/rabbitmq.js.map +0 -1
- package/build/redis.js.map +0 -1
- package/build/requests-DD2ALv0_.js +0 -583
- package/build/requests-DD2ALv0_.js.map +0 -1
- package/build/retrier-Dnjhvxol.js.map +0 -1
- package/build/timing-DZl36uXs.js.map +0 -1
- package/build/websocket.js.map +0 -1
package/build/stops.d.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { ServiceDescription } from "./description.js";
|
|
2
|
+
import { Rule } from "./law.js";
|
|
3
|
+
import { Finding, Scenario } from "./lint.js";
|
|
4
|
+
/**
|
|
5
|
+
* This module keeps apart the four ways that a pod stops (B11). Each way runs a different part of
|
|
6
|
+
* the shutdown, thus a different set of the rules of the drain guards it.
|
|
7
|
+
*/
|
|
8
|
+
/** A way that a pod stops: a deletion, a liveness restart, a crash, or a stop for lack of memory (OOM). */
|
|
9
|
+
export type StopWay = "deletion" | "liveness-restart" | "crash" | "oom";
|
|
10
|
+
/** What a way of stopping runs, and the rules of the drain that guard it. */
|
|
11
|
+
export interface Stop {
|
|
12
|
+
readonly way: StopWay;
|
|
13
|
+
/** This is the signal that the process gets first, or null when the process exits by itself. */
|
|
14
|
+
readonly signal: "SIGTERM" | "SIGKILL" | null;
|
|
15
|
+
/** This flag tells if the kubelet runs the preStop hook. */
|
|
16
|
+
readonly preStop: boolean;
|
|
17
|
+
/** This flag tells if the process runs its shutdown phases. */
|
|
18
|
+
readonly drain: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* This is how the pod leaves its endpoints: by its deletion, when its readiness fails, or when
|
|
21
|
+
* the kubelet finds that the container exited.
|
|
22
|
+
*/
|
|
23
|
+
readonly leaves: "deletion" | "readiness" | "exit";
|
|
24
|
+
/** These are the identifiers of the rules of the drain that guard this way. */
|
|
25
|
+
readonly rules: readonly string[];
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* These are the identifiers of the rules of the drain, from the data of the entry `./rules`. Each
|
|
29
|
+
* way that a pod stops applies only its own rules of this set.
|
|
30
|
+
*/
|
|
31
|
+
export declare const DRAIN_RULE_IDS: readonly string[];
|
|
32
|
+
/**
|
|
33
|
+
* These are the four ways that a pod stops.
|
|
34
|
+
* - A deletion runs the preStop hook, then SIGTERM. The endpoints drop the pod at its deletion,
|
|
35
|
+
* thus the preStop sleep and the hold must cover the propagation (O04).
|
|
36
|
+
* - A liveness restart also runs the preStop hook and SIGTERM, with the grace. The pod stays in its
|
|
37
|
+
* endpoints until its readiness fails, thus readiness must fail first (O09).
|
|
38
|
+
* - A crash and an OOM stop run no hook and no drain. The kubelet finds the exit at its relist, and
|
|
39
|
+
* no rule bounds that time. A client that can reissue a request is the only guard.
|
|
40
|
+
*/
|
|
41
|
+
export declare const STOPS: Readonly<Record<StopWay, Stop>>;
|
|
42
|
+
/** The identifier of the finding of a way of stopping that runs no drain. */
|
|
43
|
+
export declare const STOP_RULE = "stop";
|
|
44
|
+
/**
|
|
45
|
+
* This function applies the rules to a declaration for one way of stopping. A rule of the drain
|
|
46
|
+
* applies only when it guards that way. The other rules apply as `lint()` applies them. A way with
|
|
47
|
+
* no drain also gets a finding of `STOP_RULE` that depends. No rule bounds the time until the
|
|
48
|
+
* kubelet finds the exit, and the work in flight is lost. Such a way starts no phase, thus it gets no
|
|
49
|
+
* finding of `BOUND_RULES`.
|
|
50
|
+
*/
|
|
51
|
+
export declare const lintStop: (svc: ServiceDescription, scenario: Scenario, rules: readonly Rule[], way: StopWay) => Finding[];
|
package/build/stops.js
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { BOUND_RULES, lint } from "./lint.js";
|
|
2
|
+
import { DRAIN_RULES } from "./rules.js";
|
|
3
|
+
// src/stops.ts
|
|
4
|
+
/**
|
|
5
|
+
* These are the identifiers of the rules of the drain, from the data of the entry `./rules`. Each
|
|
6
|
+
* way that a pod stops applies only its own rules of this set.
|
|
7
|
+
*/
|
|
8
|
+
const DRAIN_RULE_IDS = DRAIN_RULES.map((rule) => rule.id);
|
|
9
|
+
/**
|
|
10
|
+
* These are the four ways that a pod stops.
|
|
11
|
+
* - A deletion runs the preStop hook, then SIGTERM. The endpoints drop the pod at its deletion,
|
|
12
|
+
* thus the preStop sleep and the hold must cover the propagation (O04).
|
|
13
|
+
* - A liveness restart also runs the preStop hook and SIGTERM, with the grace. The pod stays in its
|
|
14
|
+
* endpoints until its readiness fails, thus readiness must fail first (O09).
|
|
15
|
+
* - A crash and an OOM stop run no hook and no drain. The kubelet finds the exit at its relist, and
|
|
16
|
+
* no rule bounds that time. A client that can reissue a request is the only guard.
|
|
17
|
+
*/
|
|
18
|
+
const STOPS = {
|
|
19
|
+
deletion: {
|
|
20
|
+
way: "deletion",
|
|
21
|
+
signal: "SIGTERM",
|
|
22
|
+
preStop: true,
|
|
23
|
+
drain: true,
|
|
24
|
+
leaves: "deletion",
|
|
25
|
+
rules: [
|
|
26
|
+
"O04",
|
|
27
|
+
"O10",
|
|
28
|
+
"O16"
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
"liveness-restart": {
|
|
32
|
+
way: "liveness-restart",
|
|
33
|
+
signal: "SIGTERM",
|
|
34
|
+
preStop: true,
|
|
35
|
+
drain: true,
|
|
36
|
+
leaves: "readiness",
|
|
37
|
+
rules: [
|
|
38
|
+
"O09",
|
|
39
|
+
"O10",
|
|
40
|
+
"O16"
|
|
41
|
+
]
|
|
42
|
+
},
|
|
43
|
+
crash: {
|
|
44
|
+
way: "crash",
|
|
45
|
+
signal: null,
|
|
46
|
+
preStop: false,
|
|
47
|
+
drain: false,
|
|
48
|
+
leaves: "exit",
|
|
49
|
+
rules: []
|
|
50
|
+
},
|
|
51
|
+
oom: {
|
|
52
|
+
way: "oom",
|
|
53
|
+
signal: "SIGKILL",
|
|
54
|
+
preStop: false,
|
|
55
|
+
drain: false,
|
|
56
|
+
leaves: "exit",
|
|
57
|
+
rules: []
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
/** The identifier of the finding of a way of stopping that runs no drain. */
|
|
61
|
+
const STOP_RULE = "stop";
|
|
62
|
+
/**
|
|
63
|
+
* This function applies the rules to a declaration for one way of stopping. A rule of the drain
|
|
64
|
+
* applies only when it guards that way. The other rules apply as `lint()` applies them. A way with
|
|
65
|
+
* no drain also gets a finding of `STOP_RULE` that depends. No rule bounds the time until the
|
|
66
|
+
* kubelet finds the exit, and the work in flight is lost. Such a way starts no phase, thus it gets no
|
|
67
|
+
* finding of `BOUND_RULES`.
|
|
68
|
+
*/
|
|
69
|
+
const lintStop = (svc, scenario, rules, way) => {
|
|
70
|
+
const stop = STOPS[way];
|
|
71
|
+
const applies = rules.filter((rule) => !DRAIN_RULE_IDS.includes(rule.id) || stop.rules.includes(rule.id));
|
|
72
|
+
const findings = lint(svc, scenario, applies);
|
|
73
|
+
if (stop.drain) return findings;
|
|
74
|
+
return [...findings.filter((finding) => !BOUND_RULES.some((rule) => rule.id === finding.rule)), {
|
|
75
|
+
rule: STOP_RULE,
|
|
76
|
+
scope: svc.name,
|
|
77
|
+
verdict: "depends",
|
|
78
|
+
statement: `a ${way} runs no preStop hook and no drain, and no rule bounds the time until the kubelet finds the exit`,
|
|
79
|
+
window: "the work in flight is lost, and the endpoints keep the pod until the kubelet finds the exit",
|
|
80
|
+
evaluated: [],
|
|
81
|
+
unbound: ["exit_detection@pod"]
|
|
82
|
+
}];
|
|
83
|
+
};
|
|
84
|
+
export { DRAIN_RULE_IDS, STOPS, STOP_RULE, lintStop };
|
|
85
|
+
|
|
86
|
+
//# sourceMappingURL=stops.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stops.js","names":[],"sources":["../src/stops.ts"],"sourcesContent":["import type { ServiceDescription } from \"./description.ts\";\nimport type { Rule } from \"./law.ts\";\nimport type { Finding, Scenario } from \"./lint.ts\";\nimport { BOUND_RULES, lint } from \"./lint.ts\";\nimport { DRAIN_RULES } from \"./rules.ts\";\n\n/**\n * This module keeps apart the four ways that a pod stops (B11). Each way runs a different part of\n * the shutdown, thus a different set of the rules of the drain guards it.\n */\n\n/** A way that a pod stops: a deletion, a liveness restart, a crash, or a stop for lack of memory (OOM). */\nexport type StopWay = \"deletion\" | \"liveness-restart\" | \"crash\" | \"oom\";\n\n/** What a way of stopping runs, and the rules of the drain that guard it. */\nexport interface Stop {\n readonly way: StopWay;\n /** This is the signal that the process gets first, or null when the process exits by itself. */\n readonly signal: \"SIGTERM\" | \"SIGKILL\" | null;\n /** This flag tells if the kubelet runs the preStop hook. */\n readonly preStop: boolean;\n /** This flag tells if the process runs its shutdown phases. */\n readonly drain: boolean;\n /**\n * This is how the pod leaves its endpoints: by its deletion, when its readiness fails, or when\n * the kubelet finds that the container exited.\n */\n readonly leaves: \"deletion\" | \"readiness\" | \"exit\";\n /** These are the identifiers of the rules of the drain that guard this way. */\n readonly rules: readonly string[];\n}\n\n/**\n * These are the identifiers of the rules of the drain, from the data of the entry `./rules`. Each\n * way that a pod stops applies only its own rules of this set.\n */\nexport const DRAIN_RULE_IDS: readonly string[] = DRAIN_RULES.map((rule) => rule.id);\n\n/**\n * These are the four ways that a pod stops.\n * - A deletion runs the preStop hook, then SIGTERM. The endpoints drop the pod at its deletion,\n * thus the preStop sleep and the hold must cover the propagation (O04).\n * - A liveness restart also runs the preStop hook and SIGTERM, with the grace. The pod stays in its\n * endpoints until its readiness fails, thus readiness must fail first (O09).\n * - A crash and an OOM stop run no hook and no drain. The kubelet finds the exit at its relist, and\n * no rule bounds that time. A client that can reissue a request is the only guard.\n */\nexport const STOPS: Readonly<Record<StopWay, Stop>> = {\n deletion: { way: \"deletion\", signal: \"SIGTERM\", preStop: true, drain: true, leaves: \"deletion\", rules: [\"O04\", \"O10\", \"O16\"] },\n \"liveness-restart\": { way: \"liveness-restart\", signal: \"SIGTERM\", preStop: true, drain: true, leaves: \"readiness\", rules: [\"O09\", \"O10\", \"O16\"] },\n crash: { way: \"crash\", signal: null, preStop: false, drain: false, leaves: \"exit\", rules: [] },\n oom: { way: \"oom\", signal: \"SIGKILL\", preStop: false, drain: false, leaves: \"exit\", rules: [] },\n};\n\n/** The identifier of the finding of a way of stopping that runs no drain. */\nexport const STOP_RULE = \"stop\";\n\n/**\n * This function applies the rules to a declaration for one way of stopping. A rule of the drain\n * applies only when it guards that way. The other rules apply as `lint()` applies them. A way with\n * no drain also gets a finding of `STOP_RULE` that depends. No rule bounds the time until the\n * kubelet finds the exit, and the work in flight is lost. Such a way starts no phase, thus it gets no\n * finding of `BOUND_RULES`.\n */\nexport const lintStop = (svc: ServiceDescription, scenario: Scenario, rules: readonly Rule[], way: StopWay): Finding[] => {\n const stop = STOPS[way];\n const applies = rules.filter((rule) => !DRAIN_RULE_IDS.includes(rule.id) || stop.rules.includes(rule.id));\n const findings = lint(svc, scenario, applies);\n if (stop.drain) return findings;\n return [\n ...findings.filter((finding) => !BOUND_RULES.some((rule) => rule.id === finding.rule)),\n {\n rule: STOP_RULE,\n scope: svc.name,\n verdict: \"depends\",\n statement: `a ${way} runs no preStop hook and no drain, and no rule bounds the time until the kubelet finds the exit`,\n window: \"the work in flight is lost, and the endpoints keep the pod until the kubelet finds the exit\",\n evaluated: [],\n unbound: [\"exit_detection@pod\"],\n },\n ];\n};\n"],"mappings":";;;;;;;AAoCA,MAAa,iBAAoC,YAAY,KAAK,SAAS,KAAK,EAAE;;;;;;;;;;AAWlF,MAAa,QAAyC;CACpD,UAAU;EAAE,KAAK;EAAY,QAAQ;EAAW,SAAS;EAAM,OAAO;EAAM,QAAQ;EAAY,OAAO;GAAC;GAAO;GAAO;EAAK;CAAE;CAC7H,oBAAoB;EAAE,KAAK;EAAoB,QAAQ;EAAW,SAAS;EAAM,OAAO;EAAM,QAAQ;EAAa,OAAO;GAAC;GAAO;GAAO;EAAK;CAAE;CAChJ,OAAO;EAAE,KAAK;EAAS,QAAQ;EAAM,SAAS;EAAO,OAAO;EAAO,QAAQ;EAAQ,OAAO,CAAC;CAAE;CAC7F,KAAK;EAAE,KAAK;EAAO,QAAQ;EAAW,SAAS;EAAO,OAAO;EAAO,QAAQ;EAAQ,OAAO,CAAC;CAAE;AAChG;;AAGA,MAAa,YAAY;;;;;;;;AASzB,MAAa,YAAY,KAAyB,UAAoB,OAAwB,QAA4B;CACxH,MAAM,OAAO,MAAM;CACnB,MAAM,UAAU,MAAM,QAAQ,SAAS,CAAC,eAAe,SAAS,KAAK,EAAE,KAAK,KAAK,MAAM,SAAS,KAAK,EAAE,CAAC;CACxG,MAAM,WAAW,KAAK,KAAK,UAAU,OAAO;CAC5C,IAAI,KAAK,OAAO,OAAO;CACvB,OAAO,CACL,GAAG,SAAS,QAAQ,YAAY,CAAC,YAAY,MAAM,SAAS,KAAK,OAAO,QAAQ,IAAI,CAAC,GACrF;EACE,MAAM;EACN,OAAO,IAAI;EACX,SAAS;EACT,WAAW,KAAK,IAAI;EACpB,QAAQ;EACR,WAAW,CAAC;EACZ,SAAS,CAAC,oBAAoB;CAChC,CACF;AACF"}
|
package/build/testing.d.ts
CHANGED
|
@@ -1,272 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
interface FakeProcess extends ProcessPort {
|
|
9
|
-
/** This method sends a signal to each handler of it. */
|
|
10
|
-
signal(name: ExitSignal): void;
|
|
11
|
-
/** This method sends a trigger to each handler of it: a signal, or a process trigger, for example `stdin-close`. */
|
|
12
|
-
trigger(name: ExitTrigger): void;
|
|
13
|
-
/** This method sends a message of the IPC channel to each handler of the trigger `ipc-message`. */
|
|
14
|
-
message(value: unknown): void;
|
|
15
|
-
/** This method sends an error that no code caught to each handler of `onUncaught`. The default origin is `uncaughtException`. */
|
|
16
|
-
uncaught(error: unknown, origin?: UncaughtOrigin): void;
|
|
17
|
-
/** These are the exit codes, in sequence. A correct runtime exits one time. */
|
|
18
|
-
readonly exits: readonly number[];
|
|
19
|
-
/** This count is the number of handlers that are registered. */
|
|
20
|
-
readonly handlers: number;
|
|
21
|
-
/** These are the triggers that have a handler, in the sequence of their first handler. */
|
|
22
|
-
readonly triggers: readonly ExitTrigger[];
|
|
23
|
-
/** These are the times of the clock of the options at each flush and each exit, when the options give a clock. */
|
|
24
|
-
readonly log: readonly string[];
|
|
25
|
-
/** This count is the number of flushes of the output. */
|
|
26
|
-
readonly flushes: number;
|
|
27
|
-
/** This count is the number of holds of the process that are not released. */
|
|
28
|
-
readonly holds: number;
|
|
29
|
-
/** These counts are the holds that were not released at each exit, in sequence. */
|
|
30
|
-
readonly heldAtExit: readonly number[];
|
|
31
|
-
}
|
|
32
|
-
/** These options shape a fake process. */
|
|
33
|
-
interface FakeProcessOptions {
|
|
34
|
-
/** This function is the flush of the output, for example a wait on a fake clock. Without it, a flush ends at once. */
|
|
35
|
-
readonly flush?: (() => Promise<void> | void) | undefined;
|
|
36
|
-
/** This clock stamps each line of the log. */
|
|
37
|
-
readonly clock?: Clock | undefined;
|
|
38
|
-
}
|
|
39
|
-
/** This function makes a fake process. */
|
|
40
|
-
export declare const fakeProcess: (options?: FakeProcessOptions) => FakeProcess;
|
|
41
|
-
/**
|
|
42
|
-
* This function gives a seeded random number generator (mulberry32), with numbers in [0, 1). It is
|
|
43
|
-
* `mulberry32` of @mark1russell7/rigor-generators.
|
|
44
|
-
*/
|
|
45
|
-
export declare const seeded: (seed: number) => (() => number);
|
|
46
|
-
/** A contract case is one generated case of the contract test of a declaration. It throws on a failure. */
|
|
47
|
-
interface ContractCase {
|
|
48
|
-
readonly name: string;
|
|
49
|
-
run(): Promise<void>;
|
|
50
|
-
}
|
|
51
|
-
/** These options tune the contract test. */
|
|
52
|
-
interface ContractOptions {
|
|
53
|
-
/** This number is the latency that a degraded dependency adds to each check, in milliseconds. The default of the contract is 100. */
|
|
54
|
-
readonly degradeBy?: number | undefined;
|
|
55
|
-
/** This number is the seed of the jitter. */
|
|
56
|
-
readonly seed?: number | undefined;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* This function generates the contract test of a declaration. `declare` gives a new builder with
|
|
60
|
-
* the declaration and the function of each check, each time. The checks must pass at rest. The
|
|
61
|
-
* cases are:
|
|
62
|
-
* - The service at rest: each controller and each dependency is ready, and the service is alive.
|
|
63
|
-
* - Each dependency unavailable: its polls fail at once (the force-fail list). The dependency and
|
|
64
|
-
* each controller that needs it become not ready, and the other controllers stay ready. Liveness
|
|
65
|
-
* stays, unless a liveness check exercises the dependency.
|
|
66
|
-
* - Each dependency degraded: each call of its checks takes the latency longer. Nothing can fail.
|
|
67
|
-
* - Each dependency recovers: after it is unavailable, the service is again at rest.
|
|
68
|
-
* - A negative control: a client that the declaration does not name fails, and nothing changes.
|
|
69
|
-
*
|
|
70
|
-
* A dependency that no check exercises is a finding: the service cannot see it fail.
|
|
71
|
-
*/
|
|
72
|
-
export declare const contractCases: (declare: () => ServiceBuilder, options?: ContractOptions) => ContractCase[];
|
|
73
|
-
/** A held work is one unit of work that stays in flight until the test releases it. */
|
|
74
|
-
interface HeldWork {
|
|
75
|
-
/** This method lets the work end. Its promise ends when the caller of the work has its answer, or its error. */
|
|
76
|
-
release(): Promise<void>;
|
|
77
|
-
/** This flag tells if the work got the cooperative abort of the drain. */
|
|
78
|
-
readonly aborted: boolean;
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* A transport subject is a transport and the client side of its work. The kit offers work through
|
|
82
|
-
* it, holds work in flight through it, and reads the count of the transport.
|
|
83
|
-
*/
|
|
84
|
-
interface TransportSubject {
|
|
85
|
-
readonly impl: TransportImpl;
|
|
86
|
-
/** This lifecycle goes to `start()`. Without it, the kit gives a detached lifecycle. */
|
|
87
|
-
readonly life?: Lifecycle | undefined;
|
|
88
|
-
/** This method offers one unit of new work. It gives true when the transport took it, and false when it refused it. */
|
|
89
|
-
offer(): Promise<boolean>;
|
|
90
|
-
/** This method starts one unit of work that stays in flight until its release. The promise ends when the transport has it. */
|
|
91
|
-
hold(): Promise<HeldWork>;
|
|
92
|
-
/**
|
|
93
|
-
* This method sends one call through the transport, for the stream cases (option `streams`). The
|
|
94
|
-
* handler of the call gives `call.work` to `life.request(call.controller, call.route, ...)` of the
|
|
95
|
-
* lifecycle of the start, and writes its stream to the caller. It gives what the caller sees.
|
|
96
|
-
*/
|
|
97
|
-
call?(call: StreamCall): CallerView | Promise<CallerView>;
|
|
98
|
-
/** This method frees what the subject holds outside the transport: its clients and their sockets. */
|
|
99
|
-
dispose?(): Promise<void> | void;
|
|
100
|
-
}
|
|
101
|
-
/** A stream call is one request of the stream cases. The kit gives its work, and the subject sends it. */
|
|
102
|
-
interface StreamCall {
|
|
103
|
-
/** This name is the controller of the request in the lifecycle of the kit. */
|
|
104
|
-
readonly controller: string;
|
|
105
|
-
/** This name is the route of the request in the lifecycle of the kit. */
|
|
106
|
-
readonly route: string;
|
|
107
|
-
/** This function is the work of the request: one value, or a stream of values. */
|
|
108
|
-
readonly work: RequestFn<unknown>;
|
|
109
|
-
/** True tells that the answer is a stream of items. False tells that the answer is unary: one status and one value. */
|
|
110
|
-
readonly stream: boolean;
|
|
111
|
-
}
|
|
112
|
-
/** A seen end is the end of a call, as its caller read it. */
|
|
113
|
-
interface SeenEnd {
|
|
114
|
-
readonly kind: RequestEnd["kind"];
|
|
115
|
-
/**
|
|
116
|
-
* True tells that the end came in the body of the answer, after its status, for example as the
|
|
117
|
-
* last line of a stream. False tells that the end came as the status of the answer.
|
|
118
|
-
*/
|
|
119
|
-
readonly inBand: boolean;
|
|
120
|
-
}
|
|
121
|
-
/** A caller view is what the caller of a call has read so far. The kit reads it again until it changes. */
|
|
122
|
-
interface CallerView {
|
|
123
|
-
/** These values are the items that the caller read, in their sequence. */
|
|
124
|
-
readonly items: readonly unknown[];
|
|
125
|
-
/** This end is the end that the caller read, or null while the call is open. */
|
|
126
|
-
readonly end: SeenEnd | null;
|
|
127
|
-
}
|
|
128
|
-
/**
|
|
129
|
-
* This function gives a detached lifecycle: a lifecycle with no service, for the start of a
|
|
130
|
-
* transport in a test. Its state is `running`, it keeps each connection, and nothing is in flight. Each request
|
|
131
|
-
* and each use of its health throws, because no service declares a route.
|
|
132
|
-
*/
|
|
133
|
-
export declare const detachedLifecycle: () => Lifecycle;
|
|
134
|
-
/** A subject factory makes a new subject for each case, on the clock of the case. */
|
|
135
|
-
type SubjectFactory = (clock: Clock) => TransportSubject | Promise<TransportSubject>;
|
|
136
|
-
/** A conformance record is one measurement of a case, for the raw records of a run in CI. */
|
|
137
|
-
interface ConformanceRecord {
|
|
138
|
-
readonly case: string;
|
|
139
|
-
readonly what: string;
|
|
140
|
-
/** This time is the limit of the contract, in milliseconds. */
|
|
141
|
-
readonly expected: number;
|
|
142
|
-
/** This time is what the case measured, in milliseconds of the real clock. */
|
|
143
|
-
readonly measured: number;
|
|
144
|
-
}
|
|
145
|
-
/** These options tune the conformance kit. */
|
|
146
|
-
interface ConformanceOptions {
|
|
147
|
-
/** This name goes before the name of each case. */
|
|
148
|
-
readonly name?: string | undefined;
|
|
149
|
-
/** This clock moves the cases: `fake` gives exact and fast cases, and `real` measures the timing. The default is `fake`. */
|
|
150
|
-
readonly clock?: "fake" | "real" | undefined;
|
|
151
|
-
/** This time is the cap of each drain of the cases, in milliseconds. The default is 1000. */
|
|
152
|
-
readonly cap?: number | undefined;
|
|
153
|
-
/** This time is the most that a close can take, in milliseconds of the real clock. The default is 1000. */
|
|
154
|
-
readonly closeBound?: number | undefined;
|
|
155
|
-
/** This time is the most that an event can take to reach the transport, in real milliseconds. The default is 100. */
|
|
156
|
-
readonly slack?: number | undefined;
|
|
157
|
-
/** False tells that the work of the transport cannot see the cooperative abort. The default is true. */
|
|
158
|
-
readonly cooperative?: boolean | undefined;
|
|
159
|
-
/** This count is the number of works that the count case holds. The default is 3. */
|
|
160
|
-
readonly holds?: number | undefined;
|
|
161
|
-
/**
|
|
162
|
-
* True adds the stream cases (S6 D4). Then the subject gives `call`, and the kit gives the
|
|
163
|
-
* transport a lifecycle with request tracking. The default is false.
|
|
164
|
-
*/
|
|
165
|
-
readonly streams?: boolean | undefined;
|
|
166
|
-
/** This function receives each measurement, for the raw records of a run. */
|
|
167
|
-
readonly record?: ((record: ConformanceRecord) => void) | undefined;
|
|
168
|
-
}
|
|
169
|
-
/**
|
|
170
|
-
* This function generates the conformance cases of a transport (S6 A9). `make` gives a new subject
|
|
171
|
-
* for each case. Each case throws on a failure, and its message names the part of the contract.
|
|
172
|
-
* - The start: nothing is in flight, and the transport takes work.
|
|
173
|
-
* - The count: it follows each work from its events, with no move of the clock.
|
|
174
|
-
* - `stopIntake` refuses new work, keeps the work in flight, and a second stop has no effect.
|
|
175
|
-
* - `drain` ends at once with no work, ends with the last work, and holds to its deadline and not
|
|
176
|
-
* past it. It gives the cooperative abort to the work, and it does not throw.
|
|
177
|
-
* - `close` ends the work in flight in its bound, and a second close has no effect.
|
|
178
|
-
* - The stages in their sequence, as the lifecycle does them.
|
|
179
|
-
*
|
|
180
|
-
* The option `streams` adds the cases of the streams (S6 D4). Each request is a stream, and a
|
|
181
|
-
* unary call is a stream of one item. The kit gives the transport a lifecycle with request
|
|
182
|
-
* tracking. It also does the stages of the shutdown on the tracker, as the lifecycle does them.
|
|
183
|
-
* - A unary call gives one value, and its end comes as the status of the answer.
|
|
184
|
-
* - A stream stays in flight until its end, not until its first item.
|
|
185
|
-
* - A failure after the first item ends the stream with an error line in the body, not a status.
|
|
186
|
-
* A failure before the first item gets a status.
|
|
187
|
-
* - `drain` waits for an open stream. The cooperative abort ends the stream, and its caller gets the end.
|
|
188
|
-
* - At the deadline of the drain, the cut ends an open stream, and its caller gets the end.
|
|
189
|
-
*/
|
|
190
|
-
export declare const transportConformance: (make: SubjectFactory, options?: ConformanceOptions) => ContractCase[];
|
|
191
|
-
/** A fake child is a child process of a fake host. A test ends it, or a stop ends it. */
|
|
192
|
-
interface FakeChild extends ChildHandle {
|
|
193
|
-
readonly request: SpawnRequest;
|
|
194
|
-
/** These are the messages that went on its IPC channel. */
|
|
195
|
-
readonly sent: readonly unknown[];
|
|
196
|
-
/** This flag tells if the child ended. */
|
|
197
|
-
readonly ended: boolean;
|
|
198
|
-
/** This method ends the child with a code, or with a signal and a null code. A second use does nothing. */
|
|
199
|
-
exit(code: number | null, signal?: string | null): void;
|
|
200
|
-
/** This method sends data on the output of the child. */
|
|
201
|
-
output(stream: "stdout" | "stderr", chunk: string | Uint8Array): void;
|
|
202
|
-
}
|
|
203
|
-
/** A recorded command is one command that went through the fake command port. */
|
|
204
|
-
interface RecordedCommand {
|
|
205
|
-
readonly file: string;
|
|
206
|
-
readonly args: readonly string[];
|
|
207
|
-
readonly options: CommandOptions | undefined;
|
|
208
|
-
}
|
|
209
|
-
/** A recorded signal is one signal that went through the fake process port. */
|
|
210
|
-
interface RecordedSignal {
|
|
211
|
-
readonly pid: number;
|
|
212
|
-
readonly signal: StopSignal;
|
|
213
|
-
readonly group: boolean;
|
|
214
|
-
}
|
|
215
|
-
/** These options go with a fake host. */
|
|
216
|
-
interface FakeHostOptions {
|
|
217
|
-
/** This text is the platform. The default is `linux`. */
|
|
218
|
-
readonly platform?: string | undefined;
|
|
219
|
-
readonly env?: Readonly<Record<string, string | undefined>> | undefined;
|
|
220
|
-
/** The default is `/home/test`. */
|
|
221
|
-
readonly homeDir?: string | undefined;
|
|
222
|
-
/** The default is `test`. */
|
|
223
|
-
readonly user?: string | undefined;
|
|
224
|
-
/** This record names the host process. The default is the ID 100, which started at the wall time 0. */
|
|
225
|
-
readonly self?: ProcessMark | undefined;
|
|
226
|
-
/** This time is the wall time at the clock time 0, in milliseconds after the epoch. The default is 1 000 000 000 000. */
|
|
227
|
-
readonly wallStart?: number | undefined;
|
|
228
|
-
/** These files are in the fake file system at the start. */
|
|
229
|
-
readonly files?: Readonly<Record<string, string | Uint8Array>> | undefined;
|
|
230
|
-
/**
|
|
231
|
-
* This function gives the result of a command. When it gives undefined, the fake answers. `taskkill`
|
|
232
|
-
* with `/F` ends the process and gives 0. `taskkill` without `/F` gives 1, or ends a polite child. Each other command gives 0.
|
|
233
|
-
*/
|
|
234
|
-
readonly answer?: ((command: RecordedCommand) => CommandResult | undefined) | undefined;
|
|
235
|
-
readonly logger?: Logger | undefined;
|
|
236
|
-
}
|
|
237
|
-
/**
|
|
238
|
-
* A fake host is the host ports of a test, and the state behind them. It starts no process, writes no
|
|
239
|
-
* file and installs no task. Each effect is a record or a change of its state.
|
|
240
|
-
*/
|
|
241
|
-
interface FakeHost {
|
|
242
|
-
readonly ports: HostPorts;
|
|
243
|
-
readonly clock: FakeClock;
|
|
244
|
-
/** These are the files of the fake file system. */
|
|
245
|
-
readonly files: Map<string, string | Uint8Array>;
|
|
246
|
-
readonly commands: RecordedCommand[];
|
|
247
|
-
readonly signals: RecordedSignal[];
|
|
248
|
-
readonly children: FakeChild[];
|
|
249
|
-
/** This table holds each live process: its ID, and its start time or null. */
|
|
250
|
-
readonly processes: Map<number, number | null>;
|
|
251
|
-
/** This map gives the HTTP status of each address. An address that it does not have gives no answer. */
|
|
252
|
-
readonly http: Map<string, number | null>;
|
|
253
|
-
/** This map gives the text of the answer of each address, for `httpText`. The default text is empty. */
|
|
254
|
-
readonly bodies: Map<string, string>;
|
|
255
|
-
/** This set holds each `host:port` that takes a TCP connection. */
|
|
256
|
-
readonly tcp: Set<string>;
|
|
257
|
-
/** True makes each child end with the code 0 at a staged stop: SIGTERM, SIGINT, an IPC message or `taskkill` without `/F`. */
|
|
258
|
-
polite: boolean;
|
|
259
|
-
/** This function makes a file operation fail. It gets the name of the operation and the path. */
|
|
260
|
-
failFiles: ((operation: string, path: string) => boolean) | null;
|
|
261
|
-
/** This function makes a spawn fail, thus the child has no ID and ends. */
|
|
262
|
-
failSpawn: ((request: SpawnRequest) => boolean) | null;
|
|
263
|
-
/** This method gives the text of a file, or null. */
|
|
264
|
-
text(path: string): string | null;
|
|
265
|
-
/** This method lets the promises that are ready continue, without a move of the clock. */
|
|
266
|
-
settle(): Promise<void>;
|
|
267
|
-
}
|
|
268
|
-
/** This function makes a fake host. Give its `ports` to the host functions in a test. */
|
|
269
|
-
export declare const fakeHost: (options?: FakeHostOptions) => FakeHost;
|
|
1
|
+
import { Outcome } from "./latch.js";
|
|
2
|
+
import { LogEntry, LogLevel, Logger } from "./logger.js";
|
|
3
|
+
import { CheckFn } from "./poller.js";
|
|
4
|
+
import { FakeClock, FakeProcess, FakeProcessOptions, fakeClock, fakeProcess, seeded } from "./fakes.js";
|
|
5
|
+
import { ContractCase, ContractOptions, contractCases } from "./contract.js";
|
|
6
|
+
import { CallerView, ConformanceOptions, ConformanceRecord, HeldWork, SeenEnd, StreamCall, SubjectFactory, TransportSubject, detachedLifecycle, transportConformance } from "./conformance.js";
|
|
7
|
+
import { FakeChild, FakeHost, FakeHostOptions, RecordedCommand, RecordedSignal, fakeHost } from "./host/fakes.js";
|
|
270
8
|
/**
|
|
271
9
|
* A behavior is what a scripted check does when the runtime starts it:
|
|
272
10
|
* - `"ok"`, `"error"` and `"indeterminate"` give that outcome at once.
|
|
@@ -318,4 +56,4 @@ export interface QuietServer {
|
|
|
318
56
|
* and a black hole that keeps the connection look the same.
|
|
319
57
|
*/
|
|
320
58
|
export declare const quietServer: () => Promise<QuietServer>;
|
|
321
|
-
export { type CallerView, type ConformanceOptions, type ConformanceRecord, type ContractCase, type ContractOptions, type FakeChild, type FakeClock, type FakeHost, type FakeHostOptions, type FakeProcess, type FakeProcessOptions, type HeldWork, type RecordedCommand, type RecordedSignal, type SeenEnd, type StreamCall, type SubjectFactory, type TransportSubject, fakeClock };
|
|
59
|
+
export { type CallerView, type ConformanceOptions, type ConformanceRecord, type ContractCase, type ContractOptions, type FakeChild, type FakeClock, type FakeHost, type FakeHostOptions, type FakeProcess, type FakeProcessOptions, type HeldWork, type RecordedCommand, type RecordedSignal, type SeenEnd, type StreamCall, type SubjectFactory, type TransportSubject, contractCases, detachedLifecycle, fakeClock, fakeHost, fakeProcess, seeded, transportConformance };
|