@smoothbricks/nx-plugin 0.7.17 → 0.7.18
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 +204 -64
- package/dist/.build-inputs.json +24 -21
- package/dist/bun-lock-scope.d.ts +128 -20
- package/dist/bun-lock-scope.d.ts.map +1 -1
- package/dist/bun-lock-scope.js +267 -44
- package/dist/cargo-closure-input.d.ts +8 -6
- package/dist/cargo-closure-input.d.ts.map +1 -1
- package/dist/cargo-closure-input.js +14 -11
- package/dist/cargo-source-hash.d.ts +23 -4
- package/dist/cargo-source-hash.d.ts.map +1 -1
- package/dist/cargo-source-hash.js +80 -14
- package/dist/cargo-workspace.d.ts +20 -2
- package/dist/cargo-workspace.d.ts.map +1 -1
- package/dist/cargo-workspace.js +42 -22
- package/dist/ensure-built-receipt.d.ts +3 -2
- package/dist/ensure-built-receipt.d.ts.map +1 -1
- package/dist/ensure-built-receipt.js +3 -2
- package/dist/eslint-config-closure.d.ts +8 -3
- package/dist/eslint-config-closure.d.ts.map +1 -1
- package/dist/eslint-config-closure.js +24 -5
- package/dist/executors/bounded-exec/bounds.d.ts +12 -1
- package/dist/executors/bounded-exec/bounds.d.ts.map +1 -1
- package/dist/executors/bounded-exec/bounds.js +8 -4
- package/dist/executors/bounded-exec/cpu-rise.d.ts +73 -0
- package/dist/executors/bounded-exec/cpu-rise.d.ts.map +1 -0
- package/dist/executors/bounded-exec/cpu-rise.js +111 -0
- package/dist/executors/bounded-exec/executor.d.ts +1 -1
- package/dist/executors/bounded-exec/executor.d.ts.map +1 -1
- package/dist/executors/bounded-exec/executor.js +54 -22
- package/dist/executors/bounded-exec/hang-diagnostics.d.ts +8 -0
- package/dist/executors/bounded-exec/hang-diagnostics.d.ts.map +1 -1
- package/dist/executors/bounded-exec/hang-diagnostics.js +66 -6
- package/dist/executors/bounded-exec/mbx-pool.d.ts +16 -2
- package/dist/executors/bounded-exec/mbx-pool.d.ts.map +1 -1
- package/dist/executors/bounded-exec/mbx-pool.js +18 -2
- package/dist/executors/bounded-exec/mbx-reservations.d.ts +5 -2
- package/dist/executors/bounded-exec/mbx-reservations.d.ts.map +1 -1
- package/dist/executors/bounded-exec/mbx-reservations.js +5 -3
- package/dist/executors/bounded-exec/progress-channel.d.ts +38 -0
- package/dist/executors/bounded-exec/progress-channel.d.ts.map +1 -0
- package/dist/executors/bounded-exec/progress-channel.js +113 -0
- package/dist/executors/bounded-exec/progress.d.ts +2 -1
- package/dist/executors/bounded-exec/progress.d.ts.map +1 -1
- package/dist/executors/bounded-exec/ram-temp.d.ts +24 -1
- package/dist/executors/bounded-exec/ram-temp.d.ts.map +1 -1
- package/dist/executors/bounded-exec/ram-temp.js +123 -16
- package/dist/executors/bounded-exec/schema.d.ts +5 -0
- package/dist/executors/bounded-exec/schema.d.ts.map +1 -1
- package/dist/executors/bounded-exec/schema.js +17 -1
- package/dist/executors/bounded-exec/verdict.d.ts +13 -6
- package/dist/executors/bounded-exec/verdict.d.ts.map +1 -1
- package/dist/executors/bounded-exec/verdict.js +34 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +199 -89
- package/dist/managed-files/generator.d.ts +5 -1
- package/dist/managed-files/generator.d.ts.map +1 -1
- package/dist/managed-files/generator.js +22 -7
- package/dist/managed-files/render-memo.d.ts +13 -0
- package/dist/managed-files/render-memo.d.ts.map +1 -0
- package/dist/managed-files/render-memo.js +94 -0
- package/dist/test-program.d.ts +11 -6
- package/dist/test-program.d.ts.map +1 -1
- package/dist/test-program.js +39 -35
- package/dist/tool-bins.d.ts +12 -0
- package/dist/tool-bins.d.ts.map +1 -1
- package/dist/tool-bins.js +31 -6
- package/dist/typecheck-test-policy.d.ts +10 -1
- package/dist/typecheck-test-policy.d.ts.map +1 -1
- package/dist/typecheck-test-policy.js +40 -24
- package/dist/workspace-index.d.ts +14 -1
- package/dist/workspace-index.d.ts.map +1 -1
- package/dist/workspace-index.js +36 -4
- package/managed/raw/patches/nx@24.0.3.patch +703 -119
- package/managed/raw/tooling/direnv/developer-links.ts +17 -3
- package/managed/templates/github/actions/save-nix-devenv/action.yml +19 -1
- package/managed/templates/github/actions/setup-devenv/action.yml +2 -0
- package/package.json +3 -2
- package/src/bun-lock-scope.ts +293 -40
- package/src/cargo-closure-input.ts +19 -11
- package/src/cargo-source-hash.ts +103 -13
- package/src/cargo-workspace.ts +59 -20
- package/src/ensure-built-receipt.ts +3 -2
- package/src/eslint-config-closure.ts +27 -6
- package/src/executors/bounded-exec/bounds.ts +13 -4
- package/src/executors/bounded-exec/cpu-rise.ts +156 -0
- package/src/executors/bounded-exec/executor.ts +65 -21
- package/src/executors/bounded-exec/hang-diagnostics.ts +88 -6
- package/src/executors/bounded-exec/mbx-pool.ts +24 -3
- package/src/executors/bounded-exec/mbx-reservations.ts +7 -5
- package/src/executors/bounded-exec/progress-channel.ts +129 -0
- package/src/executors/bounded-exec/progress.ts +2 -1
- package/src/executors/bounded-exec/ram-temp.ts +137 -17
- package/src/executors/bounded-exec/schema.ts +19 -0
- package/src/executors/bounded-exec/verdict.ts +44 -16
- package/src/index.ts +255 -98
- package/src/managed-files/generator.ts +21 -6
- package/src/managed-files/render-memo.ts +135 -0
- package/src/test-program.ts +36 -41
- package/src/tool-bins.ts +35 -6
- package/src/typecheck-test-policy.ts +49 -24
- package/src/workspace-index.ts +40 -5
- package/test-timings.json +6 -0
|
@@ -445,6 +445,11 @@ export interface RamTempLease {
|
|
|
445
445
|
* another attach, or none, is not this lease's volume: its free space is some other filesystem's.
|
|
446
446
|
*/
|
|
447
447
|
attach: string;
|
|
448
|
+
/**
|
|
449
|
+
* The I/O Registry entry of the disk that attach is on, which the volume's marker named and the registry proved when
|
|
450
|
+
* the lease was taken: the disk a release of a lease whose volume lost its mount detaches.
|
|
451
|
+
*/
|
|
452
|
+
registryEntry: string;
|
|
448
453
|
}
|
|
449
454
|
|
|
450
455
|
export interface RamUnavailable {
|
|
@@ -686,7 +691,8 @@ type Taken =
|
|
|
686
691
|
};
|
|
687
692
|
|
|
688
693
|
type Releasing =
|
|
689
|
-
|
|
694
|
+
/** `stranded`: the volume itself went from the mountpoint, not just the lease from the volume. */
|
|
695
|
+
| { readonly kind: 'lost'; readonly detail: string; readonly stranded: boolean }
|
|
690
696
|
| { readonly kind: 'wait'; readonly claim: LifecycleClaim }
|
|
691
697
|
| {
|
|
692
698
|
readonly kind: 'claimed';
|
|
@@ -901,6 +907,7 @@ export class RamTempVolume {
|
|
|
901
907
|
directory: value.directory,
|
|
902
908
|
mountpoint: this.paths.mountpoint,
|
|
903
909
|
attach: value.volume.attach,
|
|
910
|
+
registryEntry: value.volume.registryEntry,
|
|
904
911
|
},
|
|
905
912
|
held: [...value.held, ...settled.value.held].map((lease) => lease.text),
|
|
906
913
|
reaped: [...settled.value.reaped],
|
|
@@ -942,7 +949,15 @@ export class RamTempVolume {
|
|
|
942
949
|
const directory = await this.make(op);
|
|
943
950
|
return {
|
|
944
951
|
ledger: next,
|
|
945
|
-
value: {
|
|
952
|
+
value: {
|
|
953
|
+
ok: true,
|
|
954
|
+
value: {
|
|
955
|
+
directory,
|
|
956
|
+
mountpoint: this.paths.mountpoint,
|
|
957
|
+
attach: volume.attach,
|
|
958
|
+
registryEntry: volume.registryEntry,
|
|
959
|
+
},
|
|
960
|
+
},
|
|
946
961
|
};
|
|
947
962
|
},
|
|
948
963
|
);
|
|
@@ -1015,7 +1030,7 @@ export class RamTempVolume {
|
|
|
1015
1030
|
// A lease that went while its task held it is said, never released as though it were there.
|
|
1016
1031
|
const held = leaseOn(lease, volume);
|
|
1017
1032
|
if ('lost' in held) {
|
|
1018
|
-
return { ledger, value: { kind: 'lost', detail: held.lost } };
|
|
1033
|
+
return { ledger, value: { kind: 'lost', detail: held.lost, stranded: volume?.attach !== lease.attach } };
|
|
1019
1034
|
}
|
|
1020
1035
|
if (ledger.lifecycle !== null) {
|
|
1021
1036
|
return { ledger, value: { kind: 'wait', claim: ledger.lifecycle } };
|
|
@@ -1034,7 +1049,9 @@ export class RamTempVolume {
|
|
|
1034
1049
|
case 'lost':
|
|
1035
1050
|
return {
|
|
1036
1051
|
ok: false,
|
|
1037
|
-
error:
|
|
1052
|
+
error: value.stranded
|
|
1053
|
+
? await this.releaseLost(op, lease, value.detail)
|
|
1054
|
+
: { kind: 'lease-lost', lease: lease.directory, mountpoint: lease.mountpoint, detail: value.detail },
|
|
1038
1055
|
};
|
|
1039
1056
|
case 'wait': {
|
|
1040
1057
|
const yielded = await this.yieldTo(op, value.claim, waited);
|
|
@@ -1086,6 +1103,90 @@ export class RamTempVolume {
|
|
|
1086
1103
|
}
|
|
1087
1104
|
}
|
|
1088
1105
|
|
|
1106
|
+
/**
|
|
1107
|
+
* Release a lease whose volume went from the mountpoint while its task held it. A volume that lost its mount leaves its
|
|
1108
|
+
* disk attached and mounted nowhere: no path reaches its files and no lease can be taken on it, yet its pages stay
|
|
1109
|
+
* resident until it is detached (on 2026-11-10 a restart of fseventsd stranded the user's 8 GiB disk so, owned by no
|
|
1110
|
+
* lease). The lease's own registry entry, which the registry proved when the lease was taken, makes the disk this
|
|
1111
|
+
* volume's: the release detaches it through the gateway's registry-bound `ram-detach`, under a detach claim no other
|
|
1112
|
+
* caller passes, and the lease is said lost with what became of its disk. A disk mounted anywhere is left as it is and
|
|
1113
|
+
* named, and one already gone is said so; nothing is forced.
|
|
1114
|
+
*/
|
|
1115
|
+
private async releaseLost(op: Operation, lease: RamTempLease, lost: string): Promise<RamTempError> {
|
|
1116
|
+
const said = (detail: string): RamTempError => ({
|
|
1117
|
+
kind: 'lease-lost',
|
|
1118
|
+
lease: lease.directory,
|
|
1119
|
+
mountpoint: lease.mountpoint,
|
|
1120
|
+
detail: `${lost}; ${detail}`,
|
|
1121
|
+
});
|
|
1122
|
+
const entry = lease.registryEntry;
|
|
1123
|
+
let waited: ClaimWait | null = null;
|
|
1124
|
+
for (;;) {
|
|
1125
|
+
const found = await this.diskOf(entry);
|
|
1126
|
+
if (!found.ok)
|
|
1127
|
+
return said(`its disk (registry ${entry}) could not be read: ${describeRamTempError(found.error)}`);
|
|
1128
|
+
const disk = found.value;
|
|
1129
|
+
if (disk === null) return said(`its disk (registry ${entry}) is no longer attached`);
|
|
1130
|
+
if (disk.mountpoints.length > 0) {
|
|
1131
|
+
return said(
|
|
1132
|
+
`its disk ${disk.physical} (registry ${entry}) is mounted at ${disk.mountpoints.join(', ')}, so this release left it attached`,
|
|
1133
|
+
);
|
|
1134
|
+
}
|
|
1135
|
+
const stranded = `its disk ${disk.physical} (registry ${entry}) stayed attached with its mount at ${lease.mountpoint} lost`;
|
|
1136
|
+
const taken = await this.locked(
|
|
1137
|
+
op,
|
|
1138
|
+
'release',
|
|
1139
|
+
async (ledger): Promise<Step<LifecycleClaim | null>> =>
|
|
1140
|
+
ledger.lifecycle !== null
|
|
1141
|
+
? { ledger, value: ledger.lifecycle }
|
|
1142
|
+
: { ledger: { ...ledger, lifecycle: { kind: 'detach', owner: op.owner } }, value: null },
|
|
1143
|
+
);
|
|
1144
|
+
if (!taken.ok) {
|
|
1145
|
+
const why = taken.error.kind === 'lock-denied' ? taken.error.detail : describeRamTempError(taken.error);
|
|
1146
|
+
return said(`${stranded}, and no detach claim could be taken: ${why}`);
|
|
1147
|
+
}
|
|
1148
|
+
if (taken.value !== null) {
|
|
1149
|
+
// Another caller is creating or detaching: look at the disk again once it has.
|
|
1150
|
+
const yielded = await this.yieldTo(op, taken.value, waited);
|
|
1151
|
+
if (!yielded.ok) {
|
|
1152
|
+
const why = yielded.error.kind === 'lock-denied' ? yielded.error.detail : describeRamTempError(yielded.error);
|
|
1153
|
+
return said(`${stranded}, and waiting on another caller's ${taken.value.kind} failed: ${why}`);
|
|
1154
|
+
}
|
|
1155
|
+
waited = yielded.value;
|
|
1156
|
+
continue;
|
|
1157
|
+
}
|
|
1158
|
+
const command = await this.runDetach(op, disk.physical, entry);
|
|
1159
|
+
if (!command.ok) return said(`${stranded}, and its detach failed: ${describeRamTempError(command.error)}`);
|
|
1160
|
+
if (command.value.pending !== undefined) {
|
|
1161
|
+
return said(`${stranded}; its detach still runs in the gateway (${commandText(command.value)})`);
|
|
1162
|
+
}
|
|
1163
|
+
const detached = detachOutcome(command.value, disk, 'hdiutil detach (lost mount)');
|
|
1164
|
+
return said(
|
|
1165
|
+
detached.ok
|
|
1166
|
+
? `${stranded}, and this release detached it`
|
|
1167
|
+
: `${stranded}, and its detach failed: ${describeRamTempError(detached.error)}`,
|
|
1168
|
+
);
|
|
1169
|
+
}
|
|
1170
|
+
}
|
|
1171
|
+
|
|
1172
|
+
/** The RAM disk of this volume's user and size that registry entry `entry` registers, as one read finds it; else null. */
|
|
1173
|
+
private async diskOf(entry: string): Promise<Result<AttachedRamDisk | null, RamTempError>> {
|
|
1174
|
+
const registry = await this.commands.run('/usr/sbin/ioreg', ['-r', '-c', 'IOHDIXHDDriveOutKernel', '-l', '-w0']);
|
|
1175
|
+
if (registry.status !== 0) return failed('ioreg (RAM disks)', commandText(registry));
|
|
1176
|
+
const table = await this.commands.run('/sbin/mount', []);
|
|
1177
|
+
if (table.status !== 0) return failed('mount (mount table)', commandText(table));
|
|
1178
|
+
const disks = ramDisksIn(registry.stdout, table.stdout);
|
|
1179
|
+
if (!disks.ok) return failed('ioreg (RAM disks)', disks.error);
|
|
1180
|
+
const disk = disks.value.find(
|
|
1181
|
+
(candidate) =>
|
|
1182
|
+
candidate.entry === entry && candidate.uid === this.paths.uid && candidate.sectors === this.sectors,
|
|
1183
|
+
);
|
|
1184
|
+
if (disk === undefined) return { ok: true, value: null };
|
|
1185
|
+
const { physical } = disk;
|
|
1186
|
+
return physical === null
|
|
1187
|
+
? failed('ioreg (RAM disks)', `registry entry ${entry} has published no whole disk`)
|
|
1188
|
+
: { ok: true, value: { ...disk, physical } };
|
|
1189
|
+
}
|
|
1089
1190
|
/**
|
|
1090
1191
|
* Wait out another caller's creation or detach. Liveness of its owner is its pid's, so a crashed
|
|
1091
1192
|
* owner whose pid was reused holds every caller here; past each `CLAIM_WAIT_NOTICE_MS` on the same
|
|
@@ -1798,22 +1899,41 @@ export class RamTempVolume {
|
|
|
1798
1899
|
return confirmed;
|
|
1799
1900
|
}
|
|
1800
1901
|
|
|
1801
|
-
/**
|
|
1902
|
+
/**
|
|
1903
|
+
* Check the root the volume mounts below, detach what earlier creators left, then attach and provision the volume. An
|
|
1904
|
+
* unmounted mountpoint with contents is never mounted over and its files never touched: the volume is unavailable.
|
|
1905
|
+
* Only the disk the ledger records as kept is still detached first, by that registry entry, since a lost mount
|
|
1906
|
+
* strands it beside such a directory: tasks that held leases on it may have written there after the loss. With no
|
|
1907
|
+
* kept record the refusal inspects nothing on the host.
|
|
1908
|
+
*/
|
|
1802
1909
|
private async provisionVolume(op: Operation): Promise<Result<void, RamTempError>> {
|
|
1910
|
+
let unowned: boolean;
|
|
1803
1911
|
try {
|
|
1804
|
-
const [
|
|
1805
|
-
|
|
1806
|
-
return {
|
|
1807
|
-
ok: false,
|
|
1808
|
-
error: {
|
|
1809
|
-
kind: 'ram-unavailable',
|
|
1810
|
-
reason: 'unproven-owner',
|
|
1811
|
-
detail: `${this.paths.mountpoint} is an unmounted directory with unowned contents; nothing removed or hidden by a new mount`,
|
|
1812
|
-
},
|
|
1813
|
-
};
|
|
1814
|
-
}
|
|
1912
|
+
const [mount, parent] = await Promise.all([stat(this.paths.mountpoint), stat(join(this.paths.mountpoint, '..'))]);
|
|
1913
|
+
unowned = mount.dev === parent.dev && (await readdir(this.paths.mountpoint)).length !== 0;
|
|
1815
1914
|
} catch (error) {
|
|
1816
1915
|
if (errorCode(error) !== 'ENOENT') return failed('provenance', errorText(error));
|
|
1916
|
+
unowned = false;
|
|
1917
|
+
}
|
|
1918
|
+
if (unowned) {
|
|
1919
|
+
const read = await this.readLedger();
|
|
1920
|
+
if (!read.ok) {
|
|
1921
|
+
return read;
|
|
1922
|
+
}
|
|
1923
|
+
if (read.value.ledger.kept !== null) {
|
|
1924
|
+
const strays = await this.reclaimStrays(op, this.holdersPass());
|
|
1925
|
+
if (!strays.ok) {
|
|
1926
|
+
return strays;
|
|
1927
|
+
}
|
|
1928
|
+
}
|
|
1929
|
+
return {
|
|
1930
|
+
ok: false,
|
|
1931
|
+
error: {
|
|
1932
|
+
kind: 'ram-unavailable',
|
|
1933
|
+
reason: 'unproven-owner',
|
|
1934
|
+
detail: `${this.paths.mountpoint} is an unmounted directory with unowned contents; nothing removed or hidden by a new mount`,
|
|
1935
|
+
},
|
|
1936
|
+
};
|
|
1817
1937
|
}
|
|
1818
1938
|
const root = await rootReadiness(this.paths);
|
|
1819
1939
|
if (!root.ok) {
|
|
@@ -2276,7 +2396,7 @@ function leaseOn(
|
|
|
2276
2396
|
): { readonly on: MountedVolume } | { readonly lost: string } {
|
|
2277
2397
|
if (volume === null) {
|
|
2278
2398
|
return {
|
|
2279
|
-
lost: `no marked volume is mounted at ${lease.mountpoint} any more: it was detached while the task held its lease`,
|
|
2399
|
+
lost: `no marked volume is mounted at ${lease.mountpoint} any more: it was unmounted or detached while the task held its lease`,
|
|
2280
2400
|
};
|
|
2281
2401
|
}
|
|
2282
2402
|
if (volume.attach !== lease.attach) {
|
|
@@ -64,3 +64,22 @@ export interface BoundedExecCommand {
|
|
|
64
64
|
args?: string | string[];
|
|
65
65
|
__unparsed__?: string[];
|
|
66
66
|
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* The command line a run of `options` starts: `command`, then `args`, then the arguments Nx forwards from its own
|
|
70
|
+
* command line unless `forwardAllArgs` is false. The executor runs it and graph inference reads its runner from it.
|
|
71
|
+
*/
|
|
72
|
+
export function boundedCommand(
|
|
73
|
+
options: Pick<BoundedExecCommand, 'command' | 'args' | 'forwardAllArgs' | '__unparsed__'>,
|
|
74
|
+
): string {
|
|
75
|
+
const parts = [options.command];
|
|
76
|
+
if (Array.isArray(options.args)) {
|
|
77
|
+
parts.push(...options.args);
|
|
78
|
+
} else if (options.args) {
|
|
79
|
+
parts.push(options.args);
|
|
80
|
+
}
|
|
81
|
+
if (options.forwardAllArgs !== false && options.__unparsed__?.length) {
|
|
82
|
+
parts.push(...options.__unparsed__);
|
|
83
|
+
}
|
|
84
|
+
return parts.join(' ');
|
|
85
|
+
}
|
|
@@ -3,6 +3,7 @@ import { join } from 'node:path';
|
|
|
3
3
|
import typia from 'typia';
|
|
4
4
|
import type { CpuGrantRecord } from './cpu-grant.js';
|
|
5
5
|
import { parseCpuGrant } from './cpu-grant.js';
|
|
6
|
+
import { CPU_RISING_CLASS, type CpuRise, describeCpuRises } from './cpu-rise.js';
|
|
6
7
|
import type { CpuWaitRow } from './lease-wait.js';
|
|
7
8
|
import { describeHolders, type LockWait, type Opener } from './lock-wait.js';
|
|
8
9
|
import type { MbxQueuedRequest } from './mbx-queue.js';
|
|
@@ -18,12 +19,14 @@ import { TEST_FAILURES_FILE, TEST_RESULTS_FILE } from './test-results.js';
|
|
|
18
19
|
* outlived `timeoutMs` (`total`), its fixture segment outlived `fixtureTimeoutMs`
|
|
19
20
|
* (`fixture`), or every failing test in the runner's report failed on
|
|
20
21
|
* its runner's per-test timeout (`test`). A loaded host produces exactly these.
|
|
21
|
-
* - `wedged`: `idleTimeoutMs` fired: no test finished for that long during a
|
|
22
|
-
* the suite's completion bound was exceeded, not that every process stopped:
|
|
23
|
-
* exceed it too. The verdict names tests reported running but never finished and
|
|
24
|
-
* aborted; diagnostics distinguish a stalled wait from a progressing but oversized
|
|
25
|
-
* When the snapshot named a lock wait, `lockWaits` names the file the run holds on a numbered descriptor
|
|
26
|
-
* processes outside the run that also hold it open: open-handle evidence, not a kernel lock owner.
|
|
22
|
+
* - `wedged`: `idleTimeoutMs` fired: no test finished and no running test reported progress for that long during a
|
|
23
|
+
* chargeable test interval. This proves the suite's completion bound was exceeded, not that every process stopped:
|
|
24
|
+
* an expensive active fixture can exceed it too. The verdict names tests reported running but never finished and
|
|
25
|
+
* tests the report says were aborted; diagnostics distinguish a stalled wait from a progressing but oversized
|
|
26
|
+
* lifecycle. When the snapshot named a lock wait, `lockWaits` names the file the run holds on a numbered descriptor
|
|
27
|
+
* and the processes outside the run that also hold it open: open-handle evidence, not a kernel lock owner. When it
|
|
28
|
+
* named a process whose CPU time rose, `cpuRising` names it: a build inside the test, which is a defect and not a
|
|
29
|
+
* hang. CPU never restarts the bound, which counts finished tests and the progress running tests report.
|
|
27
30
|
* - `no-space`: the run failed and its output said a write found no space (ENOSPC). Whatever its tests then reported,
|
|
28
31
|
* they failed on the disk, not on their own: the verdict names the line that said so and, when the task held one,
|
|
29
32
|
* its RAM temp volume as it stood when that line arrived.
|
|
@@ -50,6 +53,8 @@ export type BoundedExecVerdict =
|
|
|
50
53
|
readonly tests: readonly string[];
|
|
51
54
|
/** Lock waits the snapshot named: holder evidence (open handles), not a kernel lock owner. */
|
|
52
55
|
readonly lockWaits: readonly LockWait[];
|
|
56
|
+
/** Processes of the run's tree whose CPU time rose while the bound counted down: a build inside the test. */
|
|
57
|
+
readonly cpuRising: readonly CpuRise[];
|
|
53
58
|
}
|
|
54
59
|
| ({ readonly outcome: 'no-space'; readonly exitCode: number; readonly tests: readonly string[] } & NoSpaceSighting)
|
|
55
60
|
| { readonly outcome: 'failed'; readonly exitCode: number; readonly tests: readonly string[] };
|
|
@@ -60,6 +65,7 @@ export interface AdmissionQueueWait {
|
|
|
60
65
|
readonly requests: readonly MbxQueuedRequest[];
|
|
61
66
|
}
|
|
62
67
|
const isQueuedVerdict = typia.createIs<Extract<BoundedExecVerdict, { outcome: 'queued' }>>();
|
|
68
|
+
const isCpuRising = typia.createIs<readonly CpuRise[]>();
|
|
63
69
|
|
|
64
70
|
/**
|
|
65
71
|
* The task's RAM temp volume, read when a line saying ENOSPC arrived: the writer's own lease and the space left on the
|
|
@@ -344,6 +350,8 @@ export interface RunEnd {
|
|
|
344
350
|
readonly noSpace: NoSpaceSighting | null;
|
|
345
351
|
/** The lock waits the expiry's snapshot named; empty when none, or when that capture did not complete. */
|
|
346
352
|
readonly lockWaits: readonly LockWait[];
|
|
353
|
+
/** The processes the expiry's snapshot saw gain CPU time; empty when none did, or when that capture did not finish. */
|
|
354
|
+
readonly cpuRising: readonly CpuRise[];
|
|
347
355
|
/** Explicit observed queue evidence before first admission; absent after any grant. */
|
|
348
356
|
readonly admissionQueue?: AdmissionQueueWait | null;
|
|
349
357
|
}
|
|
@@ -366,7 +374,14 @@ export function judgeRun(run: RunEnd): BoundedExecVerdict {
|
|
|
366
374
|
}
|
|
367
375
|
if (run.expiry?.kind === 'idle') {
|
|
368
376
|
const tests = [...new Set([...run.expiry.tests, ...(run.report?.cancelled ?? [])])];
|
|
369
|
-
return {
|
|
377
|
+
return {
|
|
378
|
+
outcome: 'wedged',
|
|
379
|
+
idleMs: run.expiry.limitMs,
|
|
380
|
+
elapsedMs: run.elapsedMs,
|
|
381
|
+
tests,
|
|
382
|
+
lockWaits: run.lockWaits,
|
|
383
|
+
cpuRising: run.cpuRising,
|
|
384
|
+
};
|
|
370
385
|
}
|
|
371
386
|
if (run.report !== null && run.report.failed.length > 0) {
|
|
372
387
|
return { outcome: 'failed', exitCode: run.exitCode, tests: run.report.failed };
|
|
@@ -556,15 +571,25 @@ function parseVerdict(value: unknown): BoundedExecVerdict {
|
|
|
556
571
|
}
|
|
557
572
|
break;
|
|
558
573
|
case 'wedged': {
|
|
559
|
-
// A record written before lock waits were named carries none.
|
|
574
|
+
// A record written before lock waits or CPU rises were named carries none.
|
|
560
575
|
const lockWaits = value.lockWaits === undefined ? [] : parseLockWaits(value.lockWaits);
|
|
576
|
+
const recorded: unknown = value.cpuRising;
|
|
577
|
+
const cpuRising = recorded === undefined ? [] : isCpuRising(recorded) ? recorded : null;
|
|
561
578
|
if (
|
|
562
579
|
typeof value.idleMs === 'number' &&
|
|
563
580
|
typeof value.elapsedMs === 'number' &&
|
|
564
581
|
isStrings(value.tests) &&
|
|
565
|
-
lockWaits !== null
|
|
582
|
+
lockWaits !== null &&
|
|
583
|
+
cpuRising !== null
|
|
566
584
|
) {
|
|
567
|
-
return {
|
|
585
|
+
return {
|
|
586
|
+
outcome: 'wedged',
|
|
587
|
+
idleMs: value.idleMs,
|
|
588
|
+
elapsedMs: value.elapsedMs,
|
|
589
|
+
tests: value.tests,
|
|
590
|
+
lockWaits,
|
|
591
|
+
cpuRising,
|
|
592
|
+
};
|
|
568
593
|
}
|
|
569
594
|
break;
|
|
570
595
|
}
|
|
@@ -714,14 +739,17 @@ export function describeVerdict(verdict: BoundedExecVerdict): string {
|
|
|
714
739
|
: verdict.bound === 'fixture'
|
|
715
740
|
? `its fixture outlived its ${verdict.limitMs}ms bound (${verdict.elapsedMs}ms)`
|
|
716
741
|
: `outlived its ${verdict.limitMs}ms bound (${verdict.elapsedMs}ms)`;
|
|
717
|
-
case 'wedged':
|
|
718
|
-
|
|
742
|
+
case 'wedged': {
|
|
743
|
+
const locks = verdict.lockWaits.map(
|
|
744
|
+
(wait) => `; waiting on a lock: ${wait.path} held open by ${describeHolders(wait.holders)}`,
|
|
745
|
+
);
|
|
746
|
+
const cpu = verdict.cpuRising.length > 0 ? [`; ${CPU_RISING_CLASS}: ${describeCpuRises(verdict.cpuRising)}`] : [];
|
|
747
|
+
const running =
|
|
719
748
|
verdict.tests.length > 0
|
|
720
749
|
? `still running: ${verdict.tests.join(', ')}`
|
|
721
|
-
: 'the runner named no test still running'
|
|
722
|
-
}${verdict.
|
|
723
|
-
|
|
724
|
-
.join('')}`;
|
|
750
|
+
: 'the runner named no test still running';
|
|
751
|
+
return `wedged: no test finished or reported progress for ${verdict.idleMs}ms after ${verdict.elapsedMs}ms; ${running}${[...locks, ...cpu].join('')}`;
|
|
752
|
+
}
|
|
725
753
|
case 'no-space':
|
|
726
754
|
return `${describeNoSpace(verdict)}${verdict.tests.length > 0 ? `; the tests that then failed: ${verdict.tests.join(', ')}` : ''}`;
|
|
727
755
|
case 'failed':
|