feat(ql3): gate remote cancellation delivery

This commit is contained in:
whyour
2026-08-19 06:55:36 +08:00
parent 1809fbb8d3
commit 0b5f3bcb39
14 changed files with 776 additions and 25 deletions
@@ -206,6 +206,12 @@ test('starts the optional Worker listener and closes its lazy Artifact binding',
code: 'S3Unavailable',
}),
);
options.workerIngress.onCancellationDispatch({ status: 'dispatched' });
options.workerIngress.onCancellationDispatchDiagnostic(
Object.assign(new Error('must-not-be-logged'), {
code: 'CANCEL_DISPATCH_UNAVAILABLE',
}),
);
return {
status: 'active',
address: { host: '0.0.0.0', port: 5800 },
@@ -248,6 +254,25 @@ test('starts the optional Worker listener and closes its lazy Artifact binding',
),
true,
);
assert.equal(
facts.some(
(fact) =>
fact.event === 'cancellation_dispatch' &&
fact.level === 'info' &&
fact.cancellationDispatch.status === 'dispatched',
),
true,
);
assert.equal(
facts.some(
(fact) =>
fact.event === 'runtime_diagnostic' &&
fact.diagnostic.scope === 'cancellation-dispatch' &&
fact.diagnostic.code === 'CANCEL_DISPATCH_UNAVAILABLE' &&
JSON.stringify(fact).includes('must-not-be-logged') === false,
),
true,
);
});
test('creates the configured mounted Secret provider before Worker activation', async () => {