@overkill-dev/engine 0.0.40 → 0.0.41
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/clock/overkill-clock.d.ts +30 -0
- package/clock/overkill-clock.d.ts.map +1 -0
- package/clock/overkill-clock.js +53 -0
- package/clock/overkill-clock.js.map +1 -0
- package/engine/case-execution.d.ts +3 -3
- package/engine/case-execution.d.ts.map +1 -1
- package/engine/case-execution.js +20 -10
- package/engine/case-execution.js.map +1 -1
- package/engine/engine.d.ts +2 -2
- package/engine/engine.d.ts.map +1 -1
- package/engine/execution-async-leak-policy.js +2 -2
- package/engine/execution-async-leak-policy.js.map +1 -1
- package/engine/execution-global-error-observer.d.ts +20 -0
- package/engine/execution-global-error-observer.d.ts.map +1 -0
- package/engine/execution-global-error-observer.js +339 -0
- package/engine/execution-global-error-observer.js.map +1 -0
- package/engine/execution-result.js +5 -1
- package/engine/execution-result.js.map +1 -1
- package/engine/execution-supervision.d.ts +7 -5
- package/engine/execution-supervision.d.ts.map +1 -1
- package/engine/execution-supervision.js +36 -24
- package/engine/execution-supervision.js.map +1 -1
- package/engine/execution-test-plan-cases.js +72 -14
- package/engine/execution-test-plan-cases.js.map +1 -1
- package/engine/execution.d.ts +2 -2
- package/engine/execution.d.ts.map +1 -1
- package/engine/execution.js +38 -20
- package/engine/execution.js.map +1 -1
- package/engine/reporter-dispatcher.d.ts +2 -2
- package/engine/reporter-dispatcher.d.ts.map +1 -1
- package/engine/reporter.d.ts +1 -1
- package/engine/reporter.d.ts.map +1 -1
- package/engine/resource-usage-growth.js +4 -4
- package/engine/resource-usage-growth.js.map +1 -1
- package/engine/run-result.d.ts +82 -7
- package/engine/run-result.d.ts.map +1 -1
- package/engine/run-result.js +112 -0
- package/engine/run-result.js.map +1 -1
- package/engine/run-timings.d.ts +68 -0
- package/engine/run-timings.d.ts.map +1 -0
- package/engine/run-timings.js +116 -0
- package/engine/run-timings.js.map +1 -0
- package/engine/test-data.d.ts +4 -0
- package/engine/test-data.d.ts.map +1 -1
- package/engine/test-data.js +14 -1
- package/engine/test-data.js.map +1 -1
- package/package.json +3 -2
- package/packages/engine/engine.entry-point.d.ts +5 -3
- package/packages/engine/engine.entry-point.d.ts.map +1 -1
- package/packages/engine/engine.entry-point.js +3 -3
- package/packages/engine/engine.entry-point.js.map +1 -1
- package/readme.md +3 -1
- package/sbom.cdx.json +4 -21
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
2
|
+
import { caseIdentityKey } from "./identity.js";
|
|
3
|
+
import { permissionDeniedRunnerErrorFromThrown } from "./run-result.js";
|
|
4
|
+
function createStoredValue(initialValue) {
|
|
5
|
+
let currentValue = initialValue;
|
|
6
|
+
return {
|
|
7
|
+
read() {
|
|
8
|
+
return currentValue;
|
|
9
|
+
},
|
|
10
|
+
write(value) {
|
|
11
|
+
currentValue = value;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
function createRunErrorScope(boundary) {
|
|
16
|
+
const activeCaseKeys = new Set();
|
|
17
|
+
const errors = [];
|
|
18
|
+
const fatal = createStoredValue(false);
|
|
19
|
+
const fatalHandlers = new Set();
|
|
20
|
+
const fatalSignal = createStoredValue(null);
|
|
21
|
+
const phase = createStoredValue('run');
|
|
22
|
+
const stopped = createStoredValue(false);
|
|
23
|
+
function notifyFatal(error) {
|
|
24
|
+
if (!fatal.read()) {
|
|
25
|
+
fatal.write(true);
|
|
26
|
+
fatalSignal.read()?.resolve(undefined);
|
|
27
|
+
}
|
|
28
|
+
for (const handler of fatalHandlers) {
|
|
29
|
+
handler(error);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
activeCaseStarted(key) {
|
|
34
|
+
activeCaseKeys.add(key);
|
|
35
|
+
},
|
|
36
|
+
activeCaseStopped(key) {
|
|
37
|
+
activeCaseKeys.delete(key);
|
|
38
|
+
},
|
|
39
|
+
boundary,
|
|
40
|
+
async fatalSignal() {
|
|
41
|
+
if (fatal.read()) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
const currentFatalSignal = fatalSignal.read() ?? Promise.withResolvers();
|
|
45
|
+
fatalSignal.write(currentFatalSignal);
|
|
46
|
+
await currentFatalSignal.promise;
|
|
47
|
+
},
|
|
48
|
+
hasActiveCase(key) {
|
|
49
|
+
return activeCaseKeys.has(key);
|
|
50
|
+
},
|
|
51
|
+
hasFatalError() {
|
|
52
|
+
return fatal.read();
|
|
53
|
+
},
|
|
54
|
+
onFatalError(handler) {
|
|
55
|
+
fatalHandlers.add(handler);
|
|
56
|
+
return function removeFatalErrorHandler() {
|
|
57
|
+
fatalHandlers.delete(handler);
|
|
58
|
+
};
|
|
59
|
+
},
|
|
60
|
+
phase() {
|
|
61
|
+
return phase.read();
|
|
62
|
+
},
|
|
63
|
+
recordError(error) {
|
|
64
|
+
if (stopped.read()) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
errors.push(error);
|
|
68
|
+
notifyFatal(error);
|
|
69
|
+
},
|
|
70
|
+
async runPhase(nextPhase, run) {
|
|
71
|
+
const previousPhase = phase.read();
|
|
72
|
+
phase.write(nextPhase);
|
|
73
|
+
try {
|
|
74
|
+
return await run();
|
|
75
|
+
}
|
|
76
|
+
finally {
|
|
77
|
+
phase.write(previousPhase);
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
stop() {
|
|
81
|
+
stopped.write(true);
|
|
82
|
+
fatalHandlers.clear();
|
|
83
|
+
},
|
|
84
|
+
takeErrors() {
|
|
85
|
+
const currentErrors = Array.from(errors);
|
|
86
|
+
errors.length = 0;
|
|
87
|
+
return currentErrors;
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
function createActiveScopes() {
|
|
92
|
+
const scopes = [];
|
|
93
|
+
return {
|
|
94
|
+
add(scope) {
|
|
95
|
+
scopes.push(scope);
|
|
96
|
+
},
|
|
97
|
+
all() {
|
|
98
|
+
return Array.from(scopes);
|
|
99
|
+
},
|
|
100
|
+
includes(scope) {
|
|
101
|
+
return scopes.includes(scope);
|
|
102
|
+
},
|
|
103
|
+
remove(scope) {
|
|
104
|
+
const index = scopes.lastIndexOf(scope);
|
|
105
|
+
if (index !== -1) {
|
|
106
|
+
scopes.splice(index, 1);
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
size() {
|
|
110
|
+
return scopes.length;
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
export function createDisabledExecutionGlobalErrorObserver() {
|
|
115
|
+
const neverFatal = Promise.race([]);
|
|
116
|
+
return {
|
|
117
|
+
async fatalSignal() {
|
|
118
|
+
await neverFatal;
|
|
119
|
+
},
|
|
120
|
+
hasFatalError() {
|
|
121
|
+
return false;
|
|
122
|
+
},
|
|
123
|
+
onFatalError() {
|
|
124
|
+
return function removeDisabledFatalHandler() {
|
|
125
|
+
return undefined;
|
|
126
|
+
};
|
|
127
|
+
},
|
|
128
|
+
async runBoundary(run) {
|
|
129
|
+
return await run();
|
|
130
|
+
},
|
|
131
|
+
async runCase(_testCase, run) {
|
|
132
|
+
return await run();
|
|
133
|
+
},
|
|
134
|
+
async runPhase(_phase, run) {
|
|
135
|
+
return await run();
|
|
136
|
+
},
|
|
137
|
+
stop() {
|
|
138
|
+
return undefined;
|
|
139
|
+
},
|
|
140
|
+
takeErrors() {
|
|
141
|
+
return [];
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
const runScopeStorage = new AsyncLocalStorage();
|
|
146
|
+
const activeCaseStorage = new AsyncLocalStorage();
|
|
147
|
+
const activeScopes = createActiveScopes();
|
|
148
|
+
const listenersInstalled = createStoredValue(false);
|
|
149
|
+
function serializedReason(reason) {
|
|
150
|
+
if (reason instanceof Error) {
|
|
151
|
+
return {
|
|
152
|
+
message: reason.message,
|
|
153
|
+
name: reason.name,
|
|
154
|
+
stack: reason.stack ?? null
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
return {
|
|
158
|
+
message: String(reason),
|
|
159
|
+
name: 'Error',
|
|
160
|
+
stack: null
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
function hookSubtype(hook) {
|
|
164
|
+
return hook === 'uncaughtException' ? 'uncaught-exception' : 'unhandled-rejection';
|
|
165
|
+
}
|
|
166
|
+
function hookMessage(hook, reason) {
|
|
167
|
+
const label = hook === 'uncaughtException' ? 'Uncaught exception' : 'Unhandled rejection';
|
|
168
|
+
return `${label}: ${reason.message}`;
|
|
169
|
+
}
|
|
170
|
+
function hookCause(scope, hook, reason, activeCase) {
|
|
171
|
+
return {
|
|
172
|
+
boundary: scope.boundary,
|
|
173
|
+
hook,
|
|
174
|
+
origin: {
|
|
175
|
+
case: activeCase?.id ?? null,
|
|
176
|
+
work: activeCase?.workId ?? null
|
|
177
|
+
},
|
|
178
|
+
phase: activeCase === null ? scope.phase() : 'body',
|
|
179
|
+
reason: serializedReason(reason)
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
function attributedError(scope, hook, reason, activeCase) {
|
|
183
|
+
const cause = hookCause(scope, hook, reason, activeCase);
|
|
184
|
+
return {
|
|
185
|
+
attributedTo: activeCase.id,
|
|
186
|
+
attributedToWork: activeCase.workId,
|
|
187
|
+
cause,
|
|
188
|
+
message: hookMessage(hook, cause.reason),
|
|
189
|
+
subtype: hookSubtype(hook)
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
function runLevelHookError(scope, hook, reason) {
|
|
193
|
+
const cause = hookCause(scope, hook, reason, null);
|
|
194
|
+
return {
|
|
195
|
+
attributedTo: null,
|
|
196
|
+
attributedToWork: null,
|
|
197
|
+
cause,
|
|
198
|
+
message: hookMessage(hook, cause.reason),
|
|
199
|
+
subtype: hookSubtype(hook)
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
function attributionDriftError(scope, hook, reason, activeCase) {
|
|
203
|
+
const cause = hookCause(scope, hook, reason, activeCase);
|
|
204
|
+
return {
|
|
205
|
+
attributedTo: null,
|
|
206
|
+
attributedToWork: null,
|
|
207
|
+
cause,
|
|
208
|
+
message: `Async failure could not be attributed safely: ${cause.reason.message}`,
|
|
209
|
+
subtype: 'attribution-drift'
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
function scopeIncludesCase(scope, activeCase) {
|
|
213
|
+
return activeCase !== null && activeCase.scope === scope;
|
|
214
|
+
}
|
|
215
|
+
function activePermissionCase(input) {
|
|
216
|
+
if (!scopeIncludesCase(input.scope, input.activeCase)) {
|
|
217
|
+
return null;
|
|
218
|
+
}
|
|
219
|
+
return input.scope.hasActiveCase(input.activeCase.key) ? input.activeCase : null;
|
|
220
|
+
}
|
|
221
|
+
function permissionErrorForScope(input) {
|
|
222
|
+
const activeCase = activePermissionCase(input);
|
|
223
|
+
return permissionDeniedRunnerErrorFromThrown(input.reason, {
|
|
224
|
+
attributedTo: activeCase?.id ?? null,
|
|
225
|
+
attributedToWork: activeCase?.workId ?? null,
|
|
226
|
+
boundary: input.scope.boundary,
|
|
227
|
+
diagnosticChannel: null,
|
|
228
|
+
hook: input.hook,
|
|
229
|
+
phase: activeCase === null ? input.scope.phase() : 'body'
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
function errorForScope(input) {
|
|
233
|
+
const permissionError = permissionErrorForScope(input);
|
|
234
|
+
if (permissionError !== null) {
|
|
235
|
+
return permissionError;
|
|
236
|
+
}
|
|
237
|
+
if (input.ambiguousScope) {
|
|
238
|
+
return attributionDriftError(input.scope, input.hook, input.reason, scopeIncludesCase(input.scope, input.activeCase) ? input.activeCase : null);
|
|
239
|
+
}
|
|
240
|
+
if (!scopeIncludesCase(input.scope, input.activeCase)) {
|
|
241
|
+
return runLevelHookError(input.scope, input.hook, input.reason);
|
|
242
|
+
}
|
|
243
|
+
if (input.scope.hasActiveCase(input.activeCase.key)) {
|
|
244
|
+
return attributedError(input.scope, input.hook, input.reason, input.activeCase);
|
|
245
|
+
}
|
|
246
|
+
return attributionDriftError(input.scope, input.hook, input.reason, input.activeCase);
|
|
247
|
+
}
|
|
248
|
+
function currentTargetScopes() {
|
|
249
|
+
const currentScope = runScopeStorage.getStore();
|
|
250
|
+
if (currentScope !== undefined && activeScopes.includes(currentScope)) {
|
|
251
|
+
return [currentScope];
|
|
252
|
+
}
|
|
253
|
+
return activeScopes.all();
|
|
254
|
+
}
|
|
255
|
+
function receiveHookFailure(hook, reason) {
|
|
256
|
+
const activeCase = activeCaseStorage.getStore() ?? null;
|
|
257
|
+
const ambiguousScope = runScopeStorage.getStore() === undefined && activeScopes.size() > 1;
|
|
258
|
+
for (const scope of currentTargetScopes()) {
|
|
259
|
+
scope.recordError(errorForScope({ activeCase, ambiguousScope, hook, reason, scope }));
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
function receiveUnhandledRejection(reason) {
|
|
263
|
+
receiveHookFailure('unhandledRejection', reason);
|
|
264
|
+
}
|
|
265
|
+
function receiveUncaughtException(error) {
|
|
266
|
+
receiveHookFailure('uncaughtException', error);
|
|
267
|
+
}
|
|
268
|
+
function createProcessHookListeners() {
|
|
269
|
+
return {
|
|
270
|
+
install() {
|
|
271
|
+
if (listenersInstalled.read()) {
|
|
272
|
+
return;
|
|
273
|
+
}
|
|
274
|
+
process.prependListener('unhandledRejection', receiveUnhandledRejection);
|
|
275
|
+
process.prependListener('uncaughtException', receiveUncaughtException);
|
|
276
|
+
listenersInstalled.write(true);
|
|
277
|
+
},
|
|
278
|
+
removeWhenIdle() {
|
|
279
|
+
if (listenersInstalled.read() && activeScopes.size() === 0) {
|
|
280
|
+
process.removeListener('unhandledRejection', receiveUnhandledRejection);
|
|
281
|
+
process.removeListener('uncaughtException', receiveUncaughtException);
|
|
282
|
+
listenersInstalled.write(false);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
const processHookListeners = createProcessHookListeners();
|
|
288
|
+
export function createExecutionGlobalErrorObserver(boundary) {
|
|
289
|
+
const scope = createRunErrorScope(boundary);
|
|
290
|
+
return {
|
|
291
|
+
async fatalSignal() {
|
|
292
|
+
await scope.fatalSignal();
|
|
293
|
+
},
|
|
294
|
+
hasFatalError() {
|
|
295
|
+
return scope.hasFatalError();
|
|
296
|
+
},
|
|
297
|
+
onFatalError(handler) {
|
|
298
|
+
return scope.onFatalError(handler);
|
|
299
|
+
},
|
|
300
|
+
async runBoundary(run) {
|
|
301
|
+
processHookListeners.install();
|
|
302
|
+
activeScopes.add(scope);
|
|
303
|
+
try {
|
|
304
|
+
return await runScopeStorage.run(scope, run);
|
|
305
|
+
}
|
|
306
|
+
finally {
|
|
307
|
+
activeScopes.remove(scope);
|
|
308
|
+
processHookListeners.removeWhenIdle();
|
|
309
|
+
}
|
|
310
|
+
},
|
|
311
|
+
async runCase(testCase, run) {
|
|
312
|
+
const activeCase = {
|
|
313
|
+
id: testCase.id,
|
|
314
|
+
key: caseIdentityKey(testCase.id),
|
|
315
|
+
scope,
|
|
316
|
+
workId: testCase.workId
|
|
317
|
+
};
|
|
318
|
+
scope.activeCaseStarted(activeCase.key);
|
|
319
|
+
try {
|
|
320
|
+
return await activeCaseStorage.run(activeCase, run);
|
|
321
|
+
}
|
|
322
|
+
finally {
|
|
323
|
+
scope.activeCaseStopped(activeCase.key);
|
|
324
|
+
}
|
|
325
|
+
},
|
|
326
|
+
async runPhase(phase, run) {
|
|
327
|
+
return await scope.runPhase(phase, run);
|
|
328
|
+
},
|
|
329
|
+
stop() {
|
|
330
|
+
scope.stop();
|
|
331
|
+
activeScopes.remove(scope);
|
|
332
|
+
processHookListeners.removeWhenIdle();
|
|
333
|
+
},
|
|
334
|
+
takeErrors() {
|
|
335
|
+
return scope.takeErrors();
|
|
336
|
+
}
|
|
337
|
+
};
|
|
338
|
+
}
|
|
339
|
+
//# sourceMappingURL=execution-global-error-observer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execution-global-error-observer.js","sourceRoot":"","sources":["../../../../source/engine/execution-global-error-observer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,eAAe,EAA4B,MAAM,eAAe,CAAC;AAC1E,OAAO,EAAE,qCAAqC,EAAoB,MAAM,iBAAiB,CAAC;AAsF1F,SAAS,iBAAiB,CAAQ,YAAmB;IACjD,IAAI,YAAY,GAAG,YAAY,CAAC;IAEhC,OAAO;QACH,IAAI;YACA,OAAO,YAAY,CAAC;QACxB,CAAC;QACD,KAAK,CAAC,KAAK;YACP,YAAY,GAAG,KAAK,CAAC;QACzB,CAAC;KACJ,CAAC;AACN,CAAC;AAED,SAAS,mBAAmB,CAAC,QAA2B;IACpD,MAAM,cAAc,GAAG,IAAI,GAAG,EAAU,CAAC;IACzC,MAAM,MAAM,GAAkB,EAAE,CAAC;IACjC,MAAM,KAAK,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAC;IACvC,MAAM,aAAa,GAAG,IAAI,GAAG,EAAqB,CAAC;IACnD,MAAM,WAAW,GAAG,iBAAiB,CAAyC,IAAI,CAAC,CAAC;IACpF,MAAM,KAAK,GAAG,iBAAiB,CAAiB,KAAK,CAAC,CAAC;IACvD,MAAM,OAAO,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAC;IAEzC,SAAS,WAAW,CAAC,KAAkB;QACnC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC;YAChB,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAClB,WAAW,CAAC,IAAI,EAAE,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;QAC3C,CAAC;QAED,KAAK,MAAM,OAAO,IAAI,aAAa,EAAE,CAAC;YAClC,OAAO,CAAC,KAAK,CAAC,CAAC;QACnB,CAAC;IACL,CAAC;IAED,OAAO;QACH,iBAAiB,CAAC,GAAG;YACjB,cAAc,CAAC,GAAG,CAAC,GA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CAAC;YAExC,IAAI,CAAC;gBACD,OAAO,MAAM,iBAAiB,CAAC,GAAG,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC;YACxD,CAAC;oBAAS,CAAC;gBACP,KAAK,CAAC,iBAAiB,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;YAC5C,CAAC;QACL,CAAC;QACD,KAAK,CAAC,QAAQ,CAAC,KAAK,EAAE,GAAG;YACrB,OAAO,MAAM,KAAK,CAAC,QAAQ,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAC5C,CAAC;QACD,IAAI;YACA,KAAK,CAAC,IAAI,EAAE,CAAC;YACb,YAAY,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAC3B,oBAAoB,CAAC,cAAc,EAAE,CAAC;QAC1C,CAAC;QACD,UAAU;YACN,OAAO,KAAK,CAAC,UAAU,EAAE,CAAC;QAC9B,CAAC;KACJ,CAAC;AACN,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { workIdentityKey } from "./identity.js";
|
|
2
2
|
import { runStatusFromPlan, runStatusFromSummary } from "./run-result.js";
|
|
3
|
+
import { summaryRunTimings } from "./run-timings.js";
|
|
3
4
|
export function appendRunnerErrors(result, runnerErrors) {
|
|
4
5
|
if (runnerErrors.length === 0) {
|
|
5
6
|
return result;
|
|
@@ -110,7 +111,10 @@ export function createRunResult(testPlan, perTest, reporterErrors, timing) {
|
|
|
110
111
|
runnerErrors: reporterErrors,
|
|
111
112
|
status: runStatusFromPlan(summary, reporterErrors, timing.planStatus),
|
|
112
113
|
summary,
|
|
113
|
-
|
|
114
|
+
timings: summaryRunTimings({
|
|
115
|
+
testExecutionWallTimeMicroseconds: timing.testExecutionWallTimeMicroseconds,
|
|
116
|
+
totalWallTimeMicroseconds: timing.completedAtMicroseconds - timing.startedAtMicroseconds
|
|
117
|
+
})
|
|
114
118
|
};
|
|
115
119
|
}
|
|
116
120
|
//# sourceMappingURL=execution-result.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execution-result.js","sourceRoot":"","sources":["../../../../source/engine/execution-result.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"execution-result.js","sourceRoot":"","sources":["../../../../source/engine/execution-result.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EACH,iBAAiB,EACjB,oBAAoB,EAMvB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAWrD,MAAM,UAAU,kBAAkB,CAAC,MAAiB,EAAE,YAAoC;IACtF,IAAI,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC5B,OAAO,MAAM,CAAC;IAClB,CAAC;IAED,MAAM,mBAAmB,GAAG,CAAE,GAAG,MAAM,CAAC,YAAY,EAAE,GAAG,YAAY,CAAE,CAAC;IAExE,OAAO;QACH,GAAG,MAAM;QACT,YAAY,EAAE,mBAAmB;QACjC,MAAM,EAAE,oBAAoB,CAAC,MAAM,CAAC,OAAO,EAAE,mBAAmB,CAAC;KACpE,CAAC;AACN,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,sBAAsB,CACxC,KAAc,EACd,OAA0C;IAE1C,MAAM,aAAa,GAAG,MAAM,OAAO,EAAE,CAAC;IAEtC,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC3B,MAAM,IAAI,cAAc,CACpB,CAAE,KAAK,EAAE,GAAG,aAAa,CAAE,EAC3B,+CAA+C,EAC/C,EAAE,KAAK,EAAE,KAAK,EAAE,CACnB,CAAC;IACN,CAAC;IAED,MAAM,KAAK,CAAC;AAChB,CAAC;AAED,SAAS,SAAS,CAAC,UAAyB;IACxC,OAAO,UAAU,CAAC,OAAO,KAAK,MAAM,CAAC;AACzC,CAAC;AAED,SAAS,cAAc,CAAC,UAAyB;IAC7C,OAAO,UAAU,CAAC,OAAO,KAAK,cAAc,CAA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AAM,CAAC,aAAa;QACnC,YAAY,EAAE,cAAc;QAC5B,MAAM,EAAE,iBAAiB,CAAC,OAAO,EAAE,cAAc,EAAE,MAAM,CAAC,UAAU,CAAC;QACrE,OAAO;QACP,OAAO,EAAE,iBAAiB,CAAC;YACvB,iCAAiC,EAAE,MAAM,CAAC,iCAAiC;YAC3E,yBAAyB,EAAE,MAAM,CAAC,uBAAuB,GAAG,MAAM,CAAC,qBAAqB;SAC3F,CAAC;KACL,CAAC;AACN,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { OverkillClock } from '../clock/overkill-clock.ts';
|
|
2
2
|
import { type TestRuntimePolicy } from './case-execution.ts';
|
|
3
3
|
import { type PerTestResult, type ResourceUsageSnapshot, type RunnerError } from './run-result.ts';
|
|
4
4
|
import type { TestPlanCase } from './test-plan.ts';
|
|
5
5
|
import { type ExecuteResourceBudgets } from './execution-resource-budget-breach.ts';
|
|
6
|
+
import type { ExecutionGlobalErrorObserver } from './execution-global-error-observer.ts';
|
|
6
7
|
export type ExecuteTimeoutPolicy = {
|
|
7
8
|
readonly hardTimeoutMilliseconds: number;
|
|
8
9
|
readonly timeoutMilliseconds: number;
|
|
@@ -10,11 +11,12 @@ export type ExecuteTimeoutPolicy = {
|
|
|
10
11
|
export type ConcurrentCase = {
|
|
11
12
|
readonly result: PerTestResult;
|
|
12
13
|
readonly runnerErrors: readonly RunnerError[];
|
|
13
|
-
readonly
|
|
14
|
+
readonly durationMicroseconds: number;
|
|
14
15
|
};
|
|
15
16
|
export type ExecutionSupervisionDependencies = {
|
|
17
|
+
readonly globalErrorObserver: ExecutionGlobalErrorObserver;
|
|
16
18
|
readonly runtimePolicy?: TestRuntimePolicy | null;
|
|
17
|
-
readonly wallClock:
|
|
19
|
+
readonly wallClock: OverkillClock;
|
|
18
20
|
};
|
|
19
21
|
type CaseCompletion = {
|
|
20
22
|
readonly complete: (executedCase: ConcurrentCase) => void;
|
|
@@ -23,8 +25,8 @@ type CaseCompletion = {
|
|
|
23
25
|
type ActiveCase = {
|
|
24
26
|
readonly abort: () => void;
|
|
25
27
|
readonly completion: CaseCompletion;
|
|
26
|
-
readonly hardTimeout: ReturnType<
|
|
27
|
-
readonly
|
|
28
|
+
readonly hardTimeout: ReturnType<OverkillClock['setTimeout']> | null;
|
|
29
|
+
readonly startedAtMicroseconds: number;
|
|
28
30
|
readonly testCase: TestPlanCase;
|
|
29
31
|
};
|
|
30
32
|
export type ExecutionSupervision = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execution-supervision.d.ts","sourceRoot":"","sources":["../../../../source/engine/execution-supervision.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"execution-supervision.d.ts","sourceRoot":"","sources":["../../../../source/engine/execution-supervision.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAIH,KAAK,iBAAiB,EACzB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAGH,KAAK,aAAa,EAClB,KAAK,qBAAqB,EAC1B,KAAK,WAAW,EAEnB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAEH,KAAK,sBAAsB,EAE9B,MAAM,uCAAuC,CAAC;AAC/C,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,sCAAsC,CAAC;AAEzF,MAAM,MAAM,oBAAoB,GAAG;IAC/B,QAAQ,CAAC,uBAAuB,EAAE,MAAM,CAAC;IACzC,QAAQ,CAAC,mBAAmB,EAAE,MAAM,CAAC;CACxC,CAAC;AACF,MAAM,MAAM,cAAc,GAAG;IACzB,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;IAC/B,QAAQ,CAAC,YAAY,EAAE,SAAS,WAAW,EAAE,CAAC;IAC9C,QAAQ,CAAC,oBAAoB,E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C;IAC5D,QAAQ,CAAC,YAAY,EAAE,gCAAgC,CAAC;IACxD,QAAQ,CAAC,cAAc,EAAE,qBAAqB,GAAG,IAAI,CAAC;IACtD,QAAQ,CAAC,MAAM,EAAE,qBAAqB,CAAC;IACvC,QAAQ,CAAC,WAAW,EAAE,oBAAoB,CAAC;CAC9C,CAAC;AAEF,wBAAgB,0BAA0B,IAAI,oBAAoB,CAiBjE;AA8ZD,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,wBAAwB,GAAG,OAAO,CAUlF;AAED,wBAAsB,eAAe,CACjC,QAAQ,EAAE,YAAY,EACtB,aAAa,EAAE,oBAAoB,GAAG,IAAI,GAAG,SAAS,EACtD,WAAW,EAAE,oBAAoB,EACjC,YAAY,EAAE,gCAAgC,GAC/C,OAAO,CAAC,cAAc,CAAC,CAezB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { invalidTimeoutControlFailure, runTestCase, timeoutFailure } from "./case-execution.js";
|
|
2
2
|
import { workIdentityKey } from "./identity.js";
|
|
3
|
-
import { verdictFromOutcome } from "./run-result.js";
|
|
3
|
+
import { isPermissionDeniedRunnerError, verdictFromOutcome } from "./run-result.js";
|
|
4
4
|
import { findResourceBudgetBreach } from "./execution-resource-budget-breach.js";
|
|
5
5
|
export function createExecutionSupervision() {
|
|
6
6
|
const activeCases = new Map();
|
|
@@ -26,20 +26,20 @@ function createCaseCompletion() {
|
|
|
26
26
|
promise
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
|
-
function createTerminalCase(testCase, verdict,
|
|
29
|
+
function createTerminalCase(testCase, verdict, durationMicroseconds) {
|
|
30
30
|
return {
|
|
31
31
|
result: {
|
|
32
32
|
id: testCase.id,
|
|
33
33
|
outcome: null,
|
|
34
34
|
verdict,
|
|
35
35
|
workId: testCase.workId,
|
|
36
|
-
|
|
36
|
+
durationMicroseconds
|
|
37
37
|
},
|
|
38
38
|
runnerErrors: [],
|
|
39
|
-
|
|
39
|
+
durationMicroseconds
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
|
-
function failCase(testCase, failures,
|
|
42
|
+
function failCase(testCase, failures, durationMicroseconds) {
|
|
43
43
|
const outcome = {
|
|
44
44
|
failures,
|
|
45
45
|
kind: 'fail'
|
|
@@ -49,7 +49,7 @@ function failCase(testCase, failures, wallTimeMs) {
|
|
|
49
49
|
outcome,
|
|
50
50
|
verdict: verdictFromOutcome(outcome),
|
|
51
51
|
workId: testCase.workId,
|
|
52
|
-
|
|
52
|
+
durationMicroseconds
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
55
|
function timeoutControlValue(testCase) {
|
|
@@ -92,7 +92,7 @@ function resultWithTimeoutFailure(executedCase, deadlineMilliseconds, elapsedMil
|
|
|
92
92
|
}
|
|
93
93
|
return {
|
|
94
94
|
...executedCase,
|
|
95
|
-
result: failCase(executedCase.result, [failure], executedCase.
|
|
95
|
+
result: failCase(executedCase.result, [failure], executedCase.durationMicroseconds)
|
|
96
96
|
};
|
|
97
97
|
}
|
|
98
98
|
function clearTimer(wallClock, timer) {
|
|
@@ -102,14 +102,15 @@ function clearTimer(wallClock, timer) {
|
|
|
102
102
|
}
|
|
103
103
|
function policyCheckedCase(testCase, executedCase, supervision, dependencies) {
|
|
104
104
|
const errors = dependencies.runtimePolicy?.takeCaseErrors(testCase) ?? [];
|
|
105
|
-
|
|
105
|
+
const hasCasePermissionError = executedCase.runnerErrors.some(isPermissionDeniedRunnerError);
|
|
106
|
+
if (errors.length === 0 && !hasCasePermissionError) {
|
|
106
107
|
return executedCase;
|
|
107
108
|
}
|
|
108
109
|
for (const error of errors) {
|
|
109
110
|
supervision.recordRunnerError(error);
|
|
110
111
|
}
|
|
111
112
|
return {
|
|
112
|
-
...createTerminalCase(testCase, 'runtime-policy', executedCase.
|
|
113
|
+
...createTerminalCase(testCase, 'runtime-policy', executedCase.durationMicroseconds),
|
|
113
114
|
runnerErrors: executedCase.runnerErrors
|
|
114
115
|
};
|
|
115
116
|
}
|
|
@@ -157,7 +158,7 @@ function completeActiveCasesAs(supervision, verdict, dependencies) {
|
|
|
157
158
|
supervision.removeActiveCase(key);
|
|
158
159
|
activeCase.abort();
|
|
159
160
|
clearTimer(dependencies.wallClock, activeCase.hardTimeout);
|
|
160
|
-
activeCase.completion.complete(createTerminalCase(activeCase.testCase, verdict, dependencies.wallClock.
|
|
161
|
+
activeCase.completion.complete(createTerminalCase(activeCase.testCase, verdict, dependencies.wallClock.currentMonotonicMicroseconds - activeCase.startedAtMicroseconds));
|
|
161
162
|
}
|
|
162
163
|
}
|
|
163
164
|
function completeActiveCasesWithCrash(supervision, dependencies) {
|
|
@@ -171,6 +172,11 @@ function completeActiveCasesWithCrash(supervision, dependencies) {
|
|
|
171
172
|
completeActiveCasesAs(supervision, 'crashed', dependencies);
|
|
172
173
|
}
|
|
173
174
|
}
|
|
175
|
+
function completeActiveCasesAfterGlobalError(supervision, dependencies) {
|
|
176
|
+
if (supervision.activeCases.size > 0) {
|
|
177
|
+
completeActiveCasesAs(supervision, 'crashed', dependencies);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
174
180
|
function completeActiveCasesWithResourceExhaustion(breach, supervision, dependencies) {
|
|
175
181
|
const cause = {
|
|
176
182
|
...breach,
|
|
@@ -200,7 +206,7 @@ async function runCaseWithSoftTimeout(input) {
|
|
|
200
206
|
const executedCase = await runTestCaseWithPolicy(input.testCase, input.controller, input.supervision, input.dependencies);
|
|
201
207
|
clearTimer(input.dependencies.wallClock, softTimeout);
|
|
202
208
|
if (timing.timedOut) {
|
|
203
|
-
return resultWithTimeoutFailure(executedCase, input.timeoutMilliseconds, executedCase.
|
|
209
|
+
return resultWithTimeoutFailure(executedCase, input.timeoutMilliseconds, executedCase.durationMicroseconds);
|
|
204
210
|
}
|
|
205
211
|
return executedCase;
|
|
206
212
|
}
|
|
@@ -208,12 +214,12 @@ function invalidTimeoutCase(testCase, failure) {
|
|
|
208
214
|
return {
|
|
209
215
|
result: failCase(testCase, [failure], 0),
|
|
210
216
|
runnerErrors: [],
|
|
211
|
-
|
|
217
|
+
durationMicroseconds: 0
|
|
212
218
|
};
|
|
213
219
|
}
|
|
214
220
|
function registerActiveCase(input) {
|
|
215
221
|
const key = workIdentityKey(input.testCase.workId);
|
|
216
|
-
const
|
|
222
|
+
const startedAtMicroseconds = input.dependencies.wallClock.currentMonotonicMicroseconds;
|
|
217
223
|
const hardTimeout = input.timeoutPolicy === null || input.timeoutPolicy === undefined
|
|
218
224
|
? null
|
|
219
225
|
: input.dependencies.wallClock.setTimeout(function hardTimeoutActiveCases() {
|
|
@@ -225,7 +231,7 @@ function registerActiveCase(input) {
|
|
|
225
231
|
},
|
|
226
232
|
completion: input.completion,
|
|
227
233
|
hardTimeout,
|
|
228
|
-
|
|
234
|
+
startedAtMicroseconds,
|
|
229
235
|
testCase: input.testCase
|
|
230
236
|
};
|
|
231
237
|
input.supervision.addActiveCase(key, activeCase);
|
|
@@ -239,7 +245,7 @@ function completeFinishedActiveCase(input, executedCase) {
|
|
|
239
245
|
input.completion.complete(executedCase);
|
|
240
246
|
}
|
|
241
247
|
}
|
|
242
|
-
function createInconclusiveCaseResult(testCase, error,
|
|
248
|
+
function createInconclusiveCaseResult(testCase, error, durationMicroseconds) {
|
|
243
249
|
const reason = error instanceof Error ? error.message : 'Unknown test execution error.';
|
|
244
250
|
const outcome = {
|
|
245
251
|
kind: 'inconclusive',
|
|
@@ -250,19 +256,22 @@ function createInconclusiveCaseResult(testCase, error, wallTimeMs) {
|
|
|
250
256
|
outcome,
|
|
251
257
|
verdict: verdictFromOutcome(outcome),
|
|
252
258
|
workId: testCase.workId,
|
|
253
|
-
|
|
259
|
+
durationMicroseconds
|
|
254
260
|
};
|
|
255
261
|
}
|
|
256
262
|
function completeUnexpectedBodyError(input, error) {
|
|
257
|
-
const
|
|
258
|
-
input.activeCase.
|
|
263
|
+
const durationMicroseconds = input.dependencies.wallClock.currentMonotonicMicroseconds -
|
|
264
|
+
input.activeCase.startedAtMicroseconds;
|
|
259
265
|
completeFinishedActiveCase(input, {
|
|
260
|
-
result: createInconclusiveCaseResult(input.testCase, error,
|
|
266
|
+
result: createInconclusiveCaseResult(input.testCase, error, durationMicroseconds),
|
|
261
267
|
runnerErrors: [],
|
|
262
|
-
|
|
268
|
+
durationMicroseconds
|
|
263
269
|
});
|
|
264
270
|
}
|
|
265
271
|
async function runCaseBodyUnderSupervision(input) {
|
|
272
|
+
const removeFatalHandler = input.dependencies.globalErrorObserver.onFatalError(function completeCrashedCases() {
|
|
273
|
+
completeActiveCasesAfterGlobalError(input.supervision, input.dependencies);
|
|
274
|
+
});
|
|
266
275
|
try {
|
|
267
276
|
const executedCase = await Promise.race([
|
|
268
277
|
runCaseWithSoftTimeout(input),
|
|
@@ -272,16 +281,19 @@ async function runCaseBodyUnderSupervision(input) {
|
|
|
272
281
|
return executedCase;
|
|
273
282
|
}
|
|
274
283
|
catch (error) {
|
|
275
|
-
const
|
|
276
|
-
input.activeCase.
|
|
284
|
+
const durationMicroseconds = input.dependencies.wallClock.currentMonotonicMicroseconds -
|
|
285
|
+
input.activeCase.startedAtMicroseconds;
|
|
277
286
|
const fallbackCase = {
|
|
278
|
-
result: createInconclusiveCaseResult(input.testCase, error,
|
|
287
|
+
result: createInconclusiveCaseResult(input.testCase, error, durationMicroseconds),
|
|
279
288
|
runnerErrors: [],
|
|
280
|
-
|
|
289
|
+
durationMicroseconds
|
|
281
290
|
};
|
|
282
291
|
completeUnexpectedBodyError(input, error);
|
|
283
292
|
return fallbackCase;
|
|
284
293
|
}
|
|
294
|
+
finally {
|
|
295
|
+
removeFatalHandler();
|
|
296
|
+
}
|
|
285
297
|
}
|
|
286
298
|
function createCaseBodyInput(input, activeCase, timeoutMilliseconds) {
|
|
287
299
|
return {
|